One very simple technique which helps me move faster: when printf debugging, print out full log messages rather than just bare quantities: e.g. print(f"Reached speed: {velocity=}") rather than print(velocity). More typing but saves puzzling out meaning of each line at runtime.

May 12, 2022 · 7:13 PM UTC

19
8
1
219
Replying to @gdb
This is one of my favorite quick wins for using copilot I've been doing this all over the place in javascript. Each log message autocompletes to something like: console.log("<filename>: <some context>", variable) Can't wait to see copilot one day learn to use logs to fix bugs
1
2
Replying to @gdb
You can try using snoop package to generate trace and the log processing. Found faster to debug.
1
Replying to @gdb
Totally! On the JavaScript side I find using “console.log({velocity})” to be handy as well
Replying to @gdb
Also function name + timestamp.
Replying to @gdb
You're really passionate about coding, are'nt you?
Replying to @gdb
Yes! Working at Dropbox has taught me to write a log function using inspect module which does it automatically, so dlog(velocity) would print “velocity=0.5”
1
Replying to @gdb
I follow this method rigorously.
Replying to @gdb
I always print the line number when I’m trying to trace code. print(‘line 42’, velocity)
1
Replying to @gdb
Yes! Anything to save bandwidth debugging.
Replying to @gdb
IceCream is a nice way to make this even easier: github.com/gruns/icecream
1