Hacker News new | past | comments | ask | show | jobs | submit login

This is a good list. Reading and learning about the embedded world can help anyone grasp recovery and error handling techniques. Also, in C a solid understanding of errno and how to properly utilize it is important.

Also, at least personally, I stick to 3 key basic rules in C/C++ (I have a lot more, but these are important):

  1. Functions should do 1 thing and only 1 thing.  The minute a function tries to do 2 or 3 things, or it goes over 50-60 lines (with a few exceptions around conditionals) it is trying to do to much.   
 
  2. Check all parameters for validity before doing anything else in the function.
 
  3. Check all return values.  
 
Really solid and reliable code is usually way less complex then what you see in a lot of code bases. That doesn't mean it isn't a super complex problem getting solved, just that the reliability is gained by having simplicity at the lowest levels. As someone mentioned Doom is a good example of a solid code base that does some pretty complex things, but cleanly and simply overall.



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

Search: