Most of the embedded world is still stuck in C – a language that is nearing it’s 50th birthday. C++ has only started to gain traction fairly recent with a number of contributing factors:
- It’s hard. Especially recent versions of the language added a lot of features and C++’s typesystem is very rich, which doesn’t exactly make it easier.
- Compilersupport for small micros has long been neglected by compiler vendors.
- A lot of today’s embedded software engineers have little formal training in software engineering – quite a sizeable portion are electrical engineers that write the firmware for the hardware they designed before. The lack of training of means that they don’t see the point in higher levels of abstraction as provided by C++ (mind you, this is obvisously a stereotype and for sure does notfit on all electrical engineers that also write firmware – on the contrary, one of the best developers I’ve had the pleasure to work with is an electrical engineer).
- Performance has always been questioned – i.e. how high is the price we pay for using C++’s abstractions?
This series will not go into detail for any of these points – there are brighter minds out there who have already dealt with these topics in a very comprehensive way. Instead I will focus on what C++ actually brings to the table with regards to performance and memory safety for embedded systems.