Saturday 12 November 2011

How Can Bugs Be Avoided in the First Place? in C programming

How Can Bugs Be Avoided in the First Place?

There’s an old saying that an ounce of prevention is worth a pound of cure. This means that it’s always better
(easier) to ensure that a problem doesn’t occur than to attempt to fix it after it has made its ugly presence felt. This is most certainly true in computer programming! A very good programmer might spend quite a long time carefully writing a program, more than a less experienced programmer might spend. But because of his patient and careful coding techniques, he might spend little, if any, time debugging his code. Furthermore, if at some time in the future his program is to develop some problem, or needs to be modified in some way, he most likely will be able to fix the bug or add the code quite quickly. On a poorly coded program, even a generally “correct” one, fixing a bug that has cropped up only after a period of time, or modifying a program, can be a nightmare.

Programs that are easy to debug and modify, generally speaking, follow the rules of structured programming.
Take a look at some of the rules of structured programming.



No comments:

Post a Comment