• Advertisement
Sign in to follow this  
  • entries
    9
  • comments
    9
  • views
    9281

Quick thoughts on writing bug free code

Sign in to follow this  

846 views

Quick thoughts on writing bug free code


From a recent posting of mine:


>>

[background=rgb(247,247,247)]And you should write bug free code as well.[/background]





[color=rgb(40,40,40)][font=helvetica]

[background=rgb(250,251,252)]definitely.[/background]

[/font][/color]

[color=rgb(40,40,40)][font=helvetica]

[background=rgb(250,251,252)]one thing at a time, do it very well, then move on.[/background]

[/font][/color]

[color=rgb(40,40,40)][font=helvetica]

[background=rgb(250,251,252)]programming is about precision.[/background]

[/font][/color]

[color=rgb(40,40,40)][font=helvetica]

[background=rgb(250,251,252)]mind your p's and q's - cross your i's and dot your t's .[/background]

[/font][/color]

[color=rgb(40,40,40)][font=helvetica]

[background=rgb(250,251,252)]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.[/background]

[/font][/color]

[color=rgb(40,40,40)][font=helvetica]

[background=rgb(250,251,252)]nobody's perfect, but the only bugs in your program are ones you put in. [/background]

[/font][/color]

[color=rgb(40,40,40)][font=helvetica]

[background=rgb(250,251,252)]so divide and conquer. modular-ize until the parts are so simple you can't F-up .[/background]

[/font][/color]

[color=rgb(40,40,40)][font=helvetica]

[background=rgb(250,251,252)]turn complexity into a hierarchy of layered simplicity.[/background]

[/font][/color]
Sign in to follow this  


2 Comments


Recommended Comments

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.

Share this comment


Link to comment

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.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement