3 ms·
All this makes sense, except that programming microcontrollers without C++ leaves you in a world of pain. Most of what one uses C++ for, in that environment, ha
by ncmncm 6y ago
All this makes sense, except that programming microcontrollers without C++ leaves you in a world of pain. Most of what one uses C++ for, in that environment, happens at compile time, automating stuff that is bound to go wrong if you keep trying to do it by hand.
So, no virtual functions, no memory allocations, no smart pointers, probably no exceptions. But, templates that earn their keep. The normal experience with C++ done well is no need for debugging. Debugging microcontroller code is a royal pain, so preventing whole orders of possible bugs is worth a lot.
- shannongreen 6y ago> The normal experience with C++ done well is no need for debugging You cannot possibly be saying this with a straight face :)
- ncmncm 6y agoI guess it depends on who is doing it. If that's not your experience yet, it could be. Lean in on the type system, and make it work for you. The fewer bugs you leave room for, the fewer you get.