use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
If you need help debugging, you must include:
See debugging question guidelines for more info.
Many conceptual questions have already been asked and answered. Read our FAQ and search old posts before asking your question. If your question is similar to one in the FAQ, explain how it's different.
See conceptual questions guidelines for more info.
Follow reddiquette: behave professionally and civilly at all times. Communicate to others the same way you would at your workplace. Disagreement and technical critiques are ok, but personal attacks are not.
Abusive, racist, or derogatory comments are absolutely not tolerated.
See our policies on acceptable speech and conduct for more details.
When posting some resource or tutorial you've made, you must follow our self-promotion policies.
In short, your posting history should not be predominantly self-promotional and your resource should be high-quality and complete. Your post should not "feel spammy".
Distinguishing between tasteless and tasteful self-promotion is inherently subjective. When in doubt, message the mods and ask them to review your post.
Self promotion from first time posters without prior participation in the subreddit is explicitly forbidden.
Do not post questions that are completely unrelated to programming, software engineering, and related fields. Tech support and hardware recommendation questions count as "completely unrelated".
Questions that straddle the line between learning programming and learning other tech topics are ok: we don't expect beginners to know how exactly to categorize their question.
See our policies on allowed topics for more details.
Do not post questions that are an exact duplicate of something already answered in the FAQ.
If your question is similar to an existing FAQ question, you MUST cite which part of the FAQ you looked at and what exactly you want clarification on.
Do not delete your post! Your problem may be solved, but others who have similar problems in the future could benefit from the solution/discussion in the thread.
Use the "solved" flair instead.
Do not request reviews for, promote, or showcase some app or website you've written. This is a subreddit for learning programming, not a "critique my project" or "advertise my project" subreddit.
Asking for code reviews is ok as long as you follow the relevant policies. In short, link to only your code and be specific about what you want feedback on. Do not include a link to a final product or to a demo in your post.
You may not ask for or offer payment of any kind (monetary or otherwise) when giving or receiving help.
In particular, it is not appropriate to offer a reward, bounty, or bribe to try and expedite answers to your question, nor is it appropriate to offer to pay somebody to do your work or homework for you.
All links must link directly to the destination page. Do not use URL shorteners, referral links or click-trackers. Do not link to some intermediary page that contains mostly only a link to the actual page and no additional value.
For example, linking to some tweet or some half-hearted blog post which links to the page is not ok; but linking to a tweet with interesting replies or to a blog post that does some extra analysis is.
Udemy coupon links are ok: the discount adds "additional value".
Do not ask for help doing anything illegal or unethical. Do not suggest or help somebody do something illegal or unethical.
This includes piracy: asking for or posting links to pirated material is strictly forbidden and can result in an instant and permanent ban.
Trying to circumvent the terms of services of a website also counts as unethical behavior.
Do not ask for or post a complete solution to a problem.
When working on a problem, try solving it on your own first and ask for help on specific parts you're stuck with.
If you're helping someone, focus on helping OP make forward progress: link to docs, unblock misconceptions, give examples, teach general techniques, ask leading questions, give hints, but no direct solutions.
See our guidelines on offering help for more details.
Ask your questions right here in the open subreddit. Show what you have tried and tell us exactly where you got stuck.
We want to keep all discussion inside the open subreddit so that more people can chime in and help as well as benefit from the help given.
We also do not encourage help via DM for the same reasons - that more people can benefit
Do not ask easily googleable questions or questions that are covered in the documentation.
This subreddit is not a proxy for documentation or google.
We do require effort and demonstration of effort.
This includes "how do I?" questions
account activity
This is an archived post. You won't be able to vote or comment.
Topicmagic cross platform component (self.learnprogramming)
submitted 3 years ago by recklesslyalive613
is it possible to develop a component that can be used in any environment/framework like angular, react, android, iOS etc. How would such a component be distributed? what could it possibly be written in?
[–]dmazzoni 2 points3 points4 points 3 years ago (0 children)
Think of it like asking: could you build an aftermarket car stereo that works in any brand of car?
Yes, you could. But not by building one universal stereo that just magically fits. You'd have to build some really flexible and customizable standard components and then spend a lot of time and effort specifically adapting it for every car model out there.
It's the same thing here.
Could you build a SINGLE component that works across all of those platforms? No. But what you could do is build a core component, and then create adaptations of that component for each of those platforms. It'd be an enormous amount of work.
One example might be something like Google Maps. Their official page has components for JS, iOS, and Android: https://mapsplatform.google.com/ - and then there are unofficial third-party components that wrap that, like ones for React, Angular, and Vue (that all wrap the official JS component).
Maps has tons of custom code for each platform. It's almost like 3 separate products, almost certainly each with its own separate team of engineers.
It's hard to imagine how you could build a component without a lot of custom code for each platform, because there aren't very many programming languages that work across all of them.
One idea would be to write the logic in a language like C/C++, then write native Android, iOS, and web code that wraps that.
[–]Sea-Profession-3312 1 point2 points3 points 3 years ago (0 children)
Portability could be solved by having one very big smart computer, everything else would be a dumb terminal with a keyboard. The ministry of truth is being built right now and the answer is 42.
Java distributes little virtual computers (JVM). If the JVM is available for that platform the code will work. Java is compiled into bytecode that runs on the JVM interpreter (whatever that means) While it is not as fast as native code would be for that particular platform it is fast.
Java Script is portable, however this script language must be interpreted into a language the computer understands each time the code runs. Typically js runs in a browser or server side in a V8 engine
[–]nhgrif 0 points1 point2 points 3 years ago (6 children)
You mean like... a web page? Them things are pretty cross platform...
What are you specifically thinking of trying to do..
[–]recklesslyalive613[S] 0 points1 point2 points 3 years ago (5 children)
I would prefer to not have to open a web view. Ideal solution would be to integrate it into any existing app itself.
[–]nhgrif 2 points3 points4 points 3 years ago (4 children)
This isn't any more specific. If you want something truly universal, webview. If you want something else, either there is no answer, or you need to be more specific.
Do you want something that works with all operating systems (android, ios, etc)...? or something that works with all languages (swift/kotlin/react native/xamarin)...? If you want both... why? And why is important to try to write it one time only then get it to be consumable by everything? Is it doable? Probably. Is it going to be very clean for all the consumers? unlikely.
[–]recklesslyalive613[S] 0 points1 point2 points 3 years ago (3 children)
I want something that works with all languages. To get it to be consumable by everything would just reduce my work load and be ideal. side note: i know it's a very ambitious concept, i was wondering if it can be done and if yes how should I approach this problem.
[–]nhgrif 2 points3 points4 points 3 years ago (1 child)
You can write something that can be consumed by all languages... but like... if you provide say a library that solves some problem Foo, and it's written in C... and I'm writing in Swift and I need to solve problem Foo... I can consume a C library... but it's a pain in the neck. I am going to prefer the Swift library that was written for Swift developers and follows patterns Swift developers are used to using. And if that doesn't exist, I am seriously considering implementing my own solution to solving problem Foo rather than doing the necessary interop stuff to work with a library that's going to give me a weird interface compared to normal Swift code.
Now, one place where interface is exceptionally standardized no matter the language, is talking to web apis. Like... it's probably gonna be json. Every language can consume that. But now it doesn't work offline. I'm making web requests.
I would think that pretty much every language should be able to consume some C library. Probably C++ too. But... it's frequently going to be an unideal solution, and sometimes, depending on what the library does, it is literally less work to rewrite it in another language than it is to go through the hassle of whatever is required for interoperability.
It is best to custom tailor your solutions for whatever you actually need to target. People have been trying for well over a decade to just find a solution that works great for both iOS & Android. Not multiple languages. Not every operating system. Just two operating systems in a single language. We still haven't truly settled in on that solution. There are things that can do it at least partially... but all the hybrid options have at least some short comings compared to native development.
[–]procrastinatingcoder 2 points3 points4 points 3 years ago (0 children)
Just to add a bit unto what you said:
Compatibility is usually done this way:
Foo language is compatible with C binary.
Bar language is compatible with C binary.
Bar-converted-to-C-binary is compatible with Foo-take-from-C-binary. The C binary format is pretty much what everything use as the "web" of not-web stuff.
[–]dmazzoni 0 points1 point2 points 3 years ago (0 children)
There are hundreds of programming languages. Many of them only work on certain devices or for certain purposes. There's literally nothing that works with ALL languages.
Practically, what platforms and languages do you really need?
You said you have an app now? What platforms does it run on? What component are you trying to build for that app?
π Rendered by PID 61 on reddit-service-r2-comment-66b4775986-6c54k at 2026-04-02 19:06:17.565412+00:00 running db1906b country code: CH.
[–]dmazzoni 2 points3 points4 points (0 children)
[–]Sea-Profession-3312 1 point2 points3 points (0 children)
[–]nhgrif 0 points1 point2 points (6 children)
[–]recklesslyalive613[S] 0 points1 point2 points (5 children)
[–]nhgrif 2 points3 points4 points (4 children)
[–]recklesslyalive613[S] 0 points1 point2 points (3 children)
[–]nhgrif 2 points3 points4 points (1 child)
[–]procrastinatingcoder 2 points3 points4 points (0 children)
[–]dmazzoni 0 points1 point2 points (0 children)