-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?

1 Answers1

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.

aaa
  • 2,715
  • 2
  • 25
  • 40