Ideally we would use assembly language to wring the last drop of performance from small microcontrollers, and at one time that really was the only way to do it. But assembly language programming is tedious and error-prone, and if I never have to wrestle with another assembly language program that would be fine with me.
With the advent of C, things got a lot easier in the embedded systems world. As its creators stated, C is essentially a close relative of an assembler, rather like a macro assembler (there’s a good Google/Wikipedia topic, if you don’t know what a macro assembler is). A C program can be compiled into very tight and efficient code, with an almost one-to-one correspondence to the underlying assembly language that the compiler generates.
But times change, and things are extended, improved, and expanded, and thus C++ arose from C. Over time C++ has become one of the dominant languages in programming, but there are challenges when attempting to use it with a microcontroller. Continue reading ‘Ardunio Programming: C++ and Embedded Systems’