Re:“Coding is basically just ifs and for loops.”
by mjevans on Saturday December 04, 2021 @04:21PM
(#29444440)
The really useful 'print' debug lines might be kept at additional 'debug' flag levels. This is particularly useful for tracing the behavior of programs that no longer have debug symbols and are running in real environments.
Re:“Coding is basically just ifs and for loops.”
by vlunkr on Saturday December 04, 2021 @04:40PM
(#29444549)
This post by Aaron Patterson made me realize it's fine to debug with print statements
https://tenderlovemaking.com/2016/02/05/i-am-a-puts-debugger...
In rare cases I pull out a real debugger, but most of the time the right prints in the right places are just as good. I can also iterate much faster because I'm not jumping between the code the the debugger, or pulling the debugger out of the loop it's stuck in.
Re:“Coding is basically just ifs and for loops.”
by therealjumbo on Sunday December 05, 2021 @03:32PM
(#29452895)
I've come to the conclusion that it's a good skill to have since it's (or logging which is basically the same) the only debugging method that's always guaranteed to be available. For example there's lots of build and CI tools out there that have no Real Debugger.
- you don't need to write classes for everything
- it's okay to write something in a more verbose way to make it clear for other people
- your tools don't need to be perfect to get things done
I need more of these, maybe some that aren't as reductionist as Carmacks's original post.