| ▲ | kabdib 4 hours ago | ||||||||||||||||
I've been doing embedded systems in C++ since rocks were young, and this is a great summary of what to avoid. I would sure love a good coroutine runtime, and first-class support for defer. You can do these manually, but language/toolchain/debugger support is nice to have. (Pragmatically, I will be retired by the time they would be useful) | |||||||||||||||||
| ▲ | usrnm 4 hours ago | parent | next [-] | ||||||||||||||||
A defer is just a dozen lines of code nowadays, if you really need it, but in most cases you don't if you're doing RAII | |||||||||||||||||
| ▲ | wglb 4 hours ago | parent | prev | next [-] | ||||||||||||||||
It is still a bit amazing to me that it was significantly easier to do coroutines in Sigma 5 assembly and likely most any assembly than in C or C++. Two languages supposedly close to the machine. | |||||||||||||||||
| |||||||||||||||||
| ▲ | AnimalMuppet 4 hours ago | parent | prev [-] | ||||||||||||||||
In embedded, I like wrapping a class around a set of registers. Nobody else gets to write to that piece of hardware except that class. As far as avoiding things... avoid basically everything you don't need. Don't add language features that don't actually help you, just because they're there. Keep the subset you use small. But pick that subset to match your problem well, rather than out of dogma. | |||||||||||||||||