I Object to Excessive Debug Code

I saw this picture on top of an article about some new web technology. What strikes me is that most this code has to do with debugging. It looks to me the programmers maintaining this code have sprinkled debug statements through the code to see what the code is doing.

Its Friday night, do you know what your code is doing?

One of the common objections to TDD is that TDD will require programmers to have to write twice as much code. In my experience its more like 150% more (but so what I say). Is there overhead in this debug later code?

Look at this (I assume) random piece of code. The programmer(s) wrote about 200% more debug code than production code! I know we are just looking at a small sample. This is pretty typical of code created with
Debug Later Programming, the most popular way to program on the planet. The debug code tends to be ever present and outweigh the production code.

I object to the regular practice of reactively adding debug code to figure out what code is doing. I prefer to proactively prevent bugs by test-driving.

One thought on “I Object to Excessive Debug Code

  1. After a little twitter discussion about this article…

    To reuse an old pattern: I value proactive test-driven development over reactive debug-later programming. @josh_cheek @paytonrules

Leave a Reply

Your email address will not be published. Required fields are marked *

Be gone spammers * Time limit is exhausted. Please reload the CAPTCHA.