Hacker News new | ask | show | jobs
by dmitrygr 3029 days ago
For you yes, since you know how they are implemented at linker level. But get a few junior devs on your team, and you'll be wondering why hundreds of thousands of cycles run before main is called, or why some driver code is being entered before it is initialized, since someone decided to make a static singleton object for some driver and called some driver method in the constructor which will run before main(), not realizing how this stuff really works underneath.

So, C++ can be a wonderful tool in proper hands, but it is much easier to misuse than C in an embedded context.

2 comments

If you let junior programmers fuck up your codebase that much, that's not the junior's fault. You should do code reviews.
I lead a team of six, including some junior devs.

How initialization occurred (static or otherwise) was just something we made an explicit check off item in code review.

Awesome. Glad it worked out for you. I hope it stays so after you leave the team or no longer have time for each code review.