-2

I would start to learn the best programming language for embedded systems to control devices. What I have heard about that is Assembly Language. I want to know if there is any better languages to code for embedded systems?

4
  • 1
    This question is doubly off topic, first, because it is not about Arduino, and second because "what is the best" questions are off-topic on all stack exchange sites as a matter of general principle. Commented Feb 19, 2016 at 6:21
  • AFAIK, only assembly, C and sometimes C++ are supported by microcontrollers. VHDL or others by FPGA's. And then you also have PLC's with their languages. Microprocessors (i.e) Raspberry Pi or other embedded PC's run almost anything. Commented Feb 19, 2016 at 7:53
  • Try to formulate a less "opinion based" question, and ask it on general Stack Exchange, since this isn't that interesting for Arduino.SE Commented Feb 19, 2016 at 7:54
  • 1
    What I have heard about that is Assembly Language - where from? C++ is much easier to learn, and compiles into efficient code. Asking about "the best" assumes you specify criteria. What is the "best" car to buy? Depends on how many people you plan to transport, how far you plan to go, your budget, etc. Asking for "the best" without specifying any parameters makes your question unanswerable. I'm going to close this question. Feel free to edit it with new information. Thanks for your understanding and cooperation! Commented Feb 19, 2016 at 8:34

1 Answer 1

2

Before your question gets closed:

There is no such thing as "the best"

Assembly Assembly can be a very powerful language. But at the cost of some:

C C can be as powerful as assembly, only when used correct. In fact, in C (and C++) you can actually inline assembly. https://en.wikipedia.org/wiki/Inline_assembler

C++ C++ is mostly backwards compatible with C, any C compiler (should?) be able to interpret/compile C code. Which also means you could use inline assembly.

C++ also comes with a lot of usefull tools, though, when used wrongly it can actually backfire you. (Which is with most programming languages that allow a lot, but also give you the possibility to do a lot)

I believe, that C++'s Object Oriented code, with the somewhat backward compatiblity and a little abstraction from the machine (being able to port it to other machines) would be the way to go. Though, a good C/assembly programmer will out-play an average C++ programmer.

What about the other languages

C/C++ could be considered as the standard for embedded devices.

Best thing would be, to ask for individual programming languages, and why one would be better than the other. Or what the differences are.

I havent yet found anything that could "compile" Java for embedded devices. Java typically runs in a "run-time evironment". Which would come down to the fact that it needs an OS or atleast some resources for the code to be run-time interpreted.

C/C++ is also known for being "hard real-time" or atleast deterministic qua timing. Which is probably because of the same reason, not needing another layer and being pre-compiled. (And not having an runtime environment)

By these arguments, I believe C++ or C or Assembly would be the best. Or atleast most widely accepted. You should check per project, which languages are known by your developers and which other requirements there are (porting to other platforms). And it's a bit of a taste issue. I think Object Oriented code is very usefull. But some may see it as excessive/annoying.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.