upvote
Yes but I would push back a little on the idea that you simply put yourself in a "mindset of writing bug-free code."

Simpler code has fewer bugs. Embedded code tends to be simpler and more targeted in its role. Of course, putting yourself in the mindset of writing simpler code is great too - if you have the time to do so, and the problem you are solving is itself sufficiently simple.

reply
Embedded code is also simpler because it has to be. When you are confined to a microcontroller, there isn't room for bloated app frameworks, hundreds of NPM packages, etc.
reply
Web interfaces in embedded systems are very common remote exploit mechanisms, so this anecdote for sure isn't the typical experience.
reply