Hacker News new | ask | show | jobs
by vegannet 2490 days ago
I think it very much depends on the work you’re doing. My co-workers depend on debuggers which are a crutch that allow them to _feel_ like they have control over our spaghetti code — “it’s fine, I can step through!” — but the code I produce (without a debugger but through TDD) is much more resilient. There’s certainly engineering problems that benefit from a debugger but I think for most modern work they’re not essential — and often a crutch.
2 comments

While I don't think they are only ever used as a crutch, I'm starting to see more and more how they definitely are an enabler of spaghetti code.

It's not even just spaghetti but things that are very obtuse too. I often need a debugger whenever I see things in the code like if(variant.sourceId == null) and then below is the large unnamed block of code that also doesn't give any indication of what it implies. Because I have no idea what it implies, I have no idea how the data got into that state, so it's like... What case triggers this code?

I often wind up refactoring that stuff after computing an understanding of it. It usually comes out significanty easier to read and not likely you require a debugger to understand it.

So I that regard I think debuggers enable unnecessarily difficult to understand code to hang around.

I respectfully disagree. Debuggers are essential while you are debugging. Say you inherit some code and you are not sure where to make the necessary changes. Nothing beats stepping through until you find the place that does the thing and add your change.