Jump to content

  • Log In with Google      Sign In   
  • Create Account






Quick thoughts on writing bug free code

Posted by Norman Barrows, 11 September 2013 · 387 views

Quick thoughts on writing bug free code


From a recent posting of mine:


>> And you should write bug free code as well.



definitely.

one thing at a time, do it very well, then move on.

programming is about precision.

mind your p's and q's - cross your i's and dot your t's <g>.

always think ahead about what you're doing and what potential pitfalls could be: ok, this call here does memory allocation i need to deal with. this other snippet is "critical section" stuff where i have invalid addresses and such and the normal rules don't apply (constructor issues), etc.

nobody's perfect, but the only bugs in your program are ones you put in.

so divide and conquer. modular-ize until the parts are so simple you can't F-up <g>.

turn complexity into a hierarchy of layered simplicity.




Unit test, unit test, unit test. Did I mention unit test? :)

 

Lone-wolf developers don't always like the idea, but they really do help you keep the bug count down. It's easy to build up complex interactions when you have hard proof that your basic building blocks are bug free.

Unit test, unit test, unit test. Did I mention unit test? smile.png

 

Lone-wolf developers don't always like the idea, but they really do help you keep the bug count down. It's easy to build up complex interactions when you have hard proof that your basic building blocks are bug free.

 

precisely! build each lego brick carefully and test it thoroughly. Then you can build lego castles to stand the test of time.

PARTNERS