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
In OOP, I learned the hard way to always include the object pointer when printing properties inside the object. It’s easy to confuse any other object of the same class that pops up in the console with the one you’re interested in, otherwise.
Replying to @gdb
I make heavy use of a macro, LogExpr. LogExpr( vVelocity ) logs <timestamp> myfile.cpp:1000: vVelocity=[.5 -10 1.5]
1
Replying to @gdb
LLM should/can be trained to take in simplistic print() statements and generate meaningful, parsable , discernible prints()..
Replying to @gdb
Why the '='?
1
1
Replying to @gdb
Yep, I'm not sure I've ever regretted being more verbose in logging stuff like that.
Replying to @gdb
🙄
Replying to @gdb
I can relate to this! My first step is to write a macro that would print the name of the variable before printing the its value. And then use the macro everywhere :) ``` #define SHOW(X) cout << #X << " = " << (X) << "\n"; ```