Thread on debug by print vs debuggers

buttondown.email/geoffreylitt/

robert.ocallahan.org/2021/04/p

I'm pleasantly surprised that so many people care about debug by print. I've always felt like a lone voice before when talking about it. Great!

I think this conversation is missing the point, though, about what makes debug by print special. The key skill it teaches is reasoning about a program by modifying it. Interacting with your program in all its depth, rather than just through a pane of glass.

Follow

The debug cycle consists of edit, run, observe. When might better debugging tools be counter-productive? If they cause you to forget that there is a debug cycle, and to stay too long observing when a new modification would get you to the answer faster.

I’ve seen people stymied when their tools stop working. Tools will always will have limits. A bug takes hours of execution, it overflows RAM. Prints prepare one for times when you have to leave your tools behind and enter the wilderness.

· · Web · 2 · 2 · 4

@akkartik i feel prints lose usefulness in large projects, which is a case against large projects :p

@eris Disagree! The value of prints is independent of LoC or team size. It _can_ be dependent on run duration, however.

In my experience the situations where prints fail to scale are also outside the envelope of other tools. You end up needing to build new tools. (I really like github.com/akkartik/mu/blob/ma)

@akkartik One of the most difficult bugs that I've had to deal with involved a processor which ended up in a tight loop due to stack overflow. Ironically, that behavior was what was intended, albeit through a more traditional while loop. That was a fun one!

Sign in to participate in the conversation
Merveilles

Merveilles is a community project aimed at the establishment of new ways of speaking, seeing and organizing information — A culture that seeks augmentation through the arts of engineering and design. A warm welcome to any like-minded people who feel these ideals resonate with them.