Debugging skill level:
š¢ Beginner: print statements
š” Intermediate: debugger
šµ Expert: taking a shower
Debugging skill level:
š¢ Beginner: print statements
š” Intermediate: debugger
šµ Expert: taking a shower
@fribbledom Absolutely.
Best debugging tips:
* Take a shower
* Go for a walk
* Eat/drink something healthy (no, sugar _won't_ help)
* Chat with a rubber duck about it
* Chat with a friend/coworker about it
* Take a nap
@tbh @fribbledom Yes, of course, before describing it to a friend/coworker, describe it to a rubber duck.
Have edited to add.
@fribbledom All of the above, plus:
* Take a peace of paper and write down all the details you know
* Ask yourself if the problem might be somewhere else entirely
* Go through the process from start to finish, step by step (don't skip the obvious ones)
@fribbledom
š£[unknown] - using print statements to debug a small program because Iām too lazy to bother setting up the debugger.
Iāll still use the debugger for larger projects, although one of my pet peeves is getting the debugger to work for the first time on a project.
(My other pet peeve is getting stuff to compile, especially in C or C++)
@DerPumu @fribbledom Finally getting round to learning Python hit the unexpected learning curve of it being dynamically-typedā¦and Iāve only ever used statically-typed languages. I guess VB6 is technically dynamically-typed, but Iāve always just put āOption Explicitā at the top of every program and just not thought about it.
Type hints are just that: hints. Turns out they only tell me (and the IDE) what type a variableās supposed to be and doesnāt affect runtime.
Beginner: print statements
Intermediate: debugger
Expert: print statements
š¢ Beginner: print statements
š” Intermediate: debugger
šµ Expert: print statements
This is the truth and a hill I will die (or core dump) on; as good as your debugging tools are, there is absolutely no substitute for error level driven debug and trace statements.
@tezoatlipoca @fribbledom For me, it's that I eventually reached a sort of zen realization that adding the complexity / layers of a "debugger" actually increases both the entropy and time needed to find most problems.
In many cases, simple trace / print statements / code instrumentation puts you "closer to the problem".
Debuggers do have their place though.
@fribbledom
How about the stack trace?
I will use all of them, but the stack trace is my first step because it's right there (if there is one, that is).
(Except in C because the stack trace will contain several lines of ????? which I can only use to conclude that I may have a bad pointer, but I'm not even sure that's the only source of question marks in the stack trace).
@fribbledom
debugger is beginner level.
Expert is: taking a shower while your print logging runs until it reproduces.
@fribbledom A bike ride can also help!
Disclaimer: As a german fediverse member, I am obliged to turn every topic into a discussion about bikes and hating cars :-P
@WildEyedBoyFromFreecloud @words_number @fribbledom ugh.. _Europeans_. Take your functional public transit and cyclling/pedestrian friendly cities and go #flarhgunnstow out of here.
-jealous Canadian who doesn't live in one of the few cities with passable transit and cycling infrastructure