There are two distinct schools of thought when analyzing C programming language and comparing it and contrasting it to other languages. Many view C++ as a more modern version of C while others feel that C has stood the test of time and will be around for many years more.
The advantages of C programming are substantial for embedded systems.
- The close relationship between the code that is generated and actual machine code is a big advantage when trying to develop embedded systems.
- The close relationship between the underlying hardware and the representation of the hardware in the code is a big advantage for embedded programming.
- The ability to easily understand the compiler generated code and how it processes arrays and structures is a big advantage for embedded developers interested in optimizing for real time performance.
In contrast, the same is largely true for C++, however there is an extra layer of indirection in the system dealing with classes, instances and methods which makes things less clear. In addition, C++ has it's own limitations.
- An object oriented language without automatic garbage collection.
- Complex syntax
- Difficult to program in.
As a result of these limitations, C programming has maintained its leadership position embedded systems, while C++, after some years of popularity, is being replaced with more modern and easier to use languages with better high level features. These languages include Java and C#. Both of these languages have significant features to improve their performance in large distributed systems that C or C++ do not have.
C Programming is with us for a long time on embedded systems and deep in operating systems but it is obsolete for application programming.