Quick thoughts on writing bug free code
From a recent posting of mine:
>> And you should write bug free code as well.
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.