Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

90% of embedded code is horrible global variable messes like that, it's truly horrifying if you value CS and SE sensibilities and get into embedded. Invariably you'll also be expected to interface to and utilitise someone else's code of that style, so you can't even try to make much of a positive impact from within.


Meh, I've worked on several embedded systems, majority of developers did not use globals and bad coding practices. They weren't massive class hierarchies like I'm sure a lot of HN people would desire. Mostly (if c++) single inheritance, basic usage of RAII, basic usage of smart pointers (if allowed to use STL, some roll your own). The C projects I worked on were a little more ramshackle but almost no one used global variables or data. Lots of good use of translation uses to separate areas of interest. Most people avoided pointers until needed. It's not as bad as HN likes to portray.


Don't confuse static variables with global ones.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: