12

Do not use a "debugger".

A debugger is like doing a full-body scan of a sick person. You do not get any specific useful information, and you find a whole lot of information that doesn't help and is just confusing.

Source: Learn Python The Hard Way

Your thought on it?

Comments
  • 1
    Depends on the kind of debugger. gdb/pdb don't give you any information unless you ask for it.

    Print debugging works well only if your program runs quickly. If you have to wait 5 minutes after inserting another print call, a debugger is a better solution.

    For learning I think a debugger isn't really necessary. So while reading the book I'd stick to his way. Later you can then see where a debugger makes more sense.
  • 2
    The point they make there is that most of the time, python's excellent stack tracing should give you enough of an idea where shit hit the fan.
    And so far I can say that most of the time that holds true.
  • 2
    I use a debugger to try fixing memory leaks due to improper garbage collection in .NET... Why we can't dispose variables ourselves in C# is something I will never understand.
  • 2
    @evilmupp3t If it crashes, yes. But to trace down logical bugs a debugger is extremely useful. I wouldnt go near a language/tool that hasn't a decent debugger with singlestep and breakpoints.
  • 1
    Maybe this person doesn't know how to use their debugger properly.. still I have seen people rely too much on the debugger when they could just read the code to find what they need.
  • 1
    @spacem If you talked about me True I don't know much about debuggers I debug with print lines but the author Zed Shaw (you may know him from "Programming, Motherfucker" initiative) definitely must know about debuggers.
  • 1
    This comes from nature of Python. I never had to use any debugger, you just put logging/print() here and there to debug anything.
Add Comment