|
|
|
|
|
by garyrichardson
1474 days ago
|
|
I haven't coded for a while, but here's a weird situation where print() worked better in some cases for me -- you know how people say "I have better learning retention when I take notes by hand"? I found that sometimes the act of writing the print() statement helped to focus my mind and think about what I was trying to debug. For example, what specific aspects of the data structure do I need to see and why? How do I want to frame the relationship between two or more variables? Stuff like that would sometimes lead to the discovery of the bug before I even completed the print() line. Seeing the state is faster with a debugger is probably faster, but the process is an analog to explaining the situation to a rubber duck. |
|