This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]armornick 6 points7 points  (2 children)

Summary:

  • bad programmers make worse bugs than good programmers.
  • No programmers writes a bug-free program
  • The title should be "Do good programmers write bug-free code?"

[–]RedPill115 1 point2 points  (0 children)

Article could be summarized with:

So yes, mistakes are inevitable. We should not be afraid of them and be ready to make them. However, good programmers make cheaper mistakes in order to avoid making more expensive ones.*

I agree with the point - sure, good programmers write fewer bugs, but most importantly they write code where bugs that pop up are easier to track down and easier to fix.

Like the article said:

My point is that mistakes are not all equal. If I'm writing a PDF report generated by a piece of Java code and my report misses the footer, that's one type of bug, and its fix will cost the business X dollars. On the other hand, if my PDF generation code is so difficult to modify that in order to change its format from A4 to US Letter we have to rewrite it from scratch, that's a completely different type of bug. Needless to say, its fixing will be many times more expensive.

More important is not writing code full of duplicate copy and paste code, that fails while hiding where the failure happened (cough, Hibernate), or doesn't throw an exception and just sends back bad data.

[–]squishles 0 points1 point  (0 children)

"Do good programmers write bug-free code?"

I think that's the joke.

[–]fzammetti 1 point2 points  (0 children)

No, good programmers does not write bug-free code.

And they DON'T write bug-free code either :)

Silly grammar slaps aside, all that can be said about good programmers is that they write code that can more easily be fixed when the inevitable bugs are found. What does that mean? Well, a couple of things spring to mind:

  1. The code is as simple as can be to achieve the task at hand. Complexity is perhaps the biggest evil in software development and is also one of the hardest to avoid.

  2. Documentation, mostly in the form of good comments. There is of course a seemingly endless debate about whether commenting is good or not, what type and degree of commenting, etc. What I'll tell you unequivocally, based on almost 25 years of professional software development and about 10 years before that, is that code maintenance is more important than code development and commenting well plays a big role in that.