Because, sadly, I more often than not do NOT have access to a debugger.
Learning how to write good debugging print messages is a skill. And nicely transfers to writing good debug log messages. Which makes diagnosing user issues much easier.
Because, sadly, I more often than not do NOT have access to a debugger.
Learning how to write good debugging print messages is a skill. And nicely transfers to writing good debug log messages. Which makes diagnosing user issues much easier.
I like this rule of thumb and it goes nicely with the “if you have more than 3 arguments to a function, consider making a struct to pass the arguments in” rule of thumb because
You can have the struct use a named lifetime (or several) for the different parameters so it doesn’t own them!
Best of both worlds.