Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

During a phone interview I had, the interviewer was asking me questions about my previous job as a web developer. After discussing how I had used Eclipse to write Java Servlets, he asked me the question whether I was familiar with the debugger, "you know, stepping through code, setting breakpoints, et cetera."

I responded by saying something along the lines that I use the debugger almost every day at work in order to track down any bugs that may arise.

Looking back now, it sounds like saying "I use the debugger almost every day" makes it seem like I write poor code that I constantly have to debug.

So, my question is: Is using the debugger frequently a sign of bad programming, or just a natural part of the development process?

share|improve this question

closed as primarily opinion-based by Ixrec, MichaelT, Kilian Foth, enderland, gnat Jun 22 at 16:16

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

We once hired a junior Java programmer who had never used a debugger before ... wished I had asked the same question asked to you. I always think of using the debugger as a natural part of the development process. –  Marcelo Aug 16 '11 at 17:37
Donald Knuth and Neil Butterworth do not use the debugger. The mere mortals do though. –  Job Aug 16 '11 at 20:18
Debugger is only useful with 3rd party code. With your own you can do much better without such a limited tool. Assertions, multi-tier logging and embedded scripting are a way much more powerful debugging tools than interactive debuggers. –  SK-logic Jan 24 '12 at 9:15

5 Answers 5

up vote 39 down vote accepted

The best programmers are masters of debugging. You're worrying too much friend. Using the debugger every day is a sign that you live in the real world.

share|improve this answer
I agree... I wish I was such a good programmer that I never needed it, but I'm not and I do need it :) –  Pelshoff Aug 16 '11 at 17:39
@Pleshoff No matter how good you might be, if you work on a team you will need to use a debugger to find out how someone else has broken your code. –  jimreed Aug 16 '11 at 17:43
The best programmers might be masters of debuggers but I don't think good web developers use them almost every day. Typically webapps have instrumentation of some form built in, and high level languages like java/ruby/python rarely requires a debugger because of this. I would say novices are more likely to use a debugger daily, whereas a complete noob would have no idea what a debugger is. Advanced programmers know what it is and just have developed better ways to find bugs. –  Kevin Aug 16 '11 at 17:57
@Kevin - I have to disagree. In my experience, debugging is an essential part of any competent developer's workflow, provided they are on a platform that supports it. Combined with unit tests, what possible "better ways to find bugs" are there than a debugger for an experienced programmer? –  Morgan Herlocker Aug 16 '11 at 18:09
@Kevin I'm a Java programmer, I use the debugger. If you rarely have a need to set breakpoints, inspect variable values and check general application state, maybe they should clone you a couple of thousand times. –  Marcelo Aug 16 '11 at 20:17

It sounds like you might have missed the point of the question. Clearly the interviewer was hoping you would say that you had familiarity with the debugger. If someone told me that they never used the debugger (on a relevant platform, of course), that would be a pretty clear sign to me that they were seriously lacking in experience. Leaning on a debugger is not the most effective way to write all code, but if you are delving into non-trivial code on a regular basis it would be quite foolish to not use it as a tool on a regular basis. I do not use the SQL trace profiler for testing the validity and correctness of my data access code, but I will certainly get it out to troubleshoot a hard to nail down issue. Debugging tools allow us to detect problems in code much more quickly and effectively than we would otherwise. Saying you wish you did not need a debugger is like saying you really wish you could fly...it's just not going to happen. The difference between great coders and terrible ones is rarely their performance on the first iterations, but on the final iterations, so I really would not worry if your code does not compile and run flawlessly on your first try everytime.

share|improve this answer

is using the debugger frequently a bad sign...

It's not at all bad -- but don't write code carelessly, thinking at the back of your mind that it's OK for errors to creep in because i'll rip'em off while debugging. That's bad -- try to avoid errors as much as possible while writing the program.

Remember, debugging is time consuming -- and the more you rely on it to catch errors, the more you trade off you productive hours for draggy chores.

share|improve this answer
True, but I never use the debugger as an excuse to write lousy code; however, since I didn't mention that in the interview, I suppose the interviewer could have taken it that way. –  Ivan Aug 16 '11 at 17:47

The answer is that if you are "using the debugger frequently" then you might not be doing unit testing right (see TDD etc.).

share|improve this answer

Is using the debugger frequently a sign of bad programming, or just a natural part of the development process? no is it not , like greengit said,

In many cases debugger is a blessing when one is going through the code like for example the coder is going through the code he only wrote a few months back, and you have no patience to just look at the code and find out what is the flow that the code is following,

daily use (not recommended though as time consuming) of the debugger may help you clean up you own code , refactor with by removing the unwanted lines of code that one may have put in.

honestly i do that alot by de-bugging my own code ,so i can make it cleaner, so frequently debugging has made me a slightly cleaner code,

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.