And to be honest, it still is hard to beat C if you want real-time properties and a garbage collection that don't risk overflowing memory.
But if you want to keep C but write programs in a more object-oriented style how do you do? It is not as hard as one would think.
Here are some web pages which give some useful tips. Note that they are not always compatible!
- Phil's guide to object-oriented ANSI C
- Object-oriented programming in C by Paul Field
- Object-oriented programming in ANSI- C by Axel-Tobias Schreiner
I have reviewed code for several ECUs used in Volvo cars, and none have used an object-oriented style. The reason I bring up object-oriented programming in C in this blog is that it simplifies the implementation of many patterns, the subject is not really new...