I often use my initials and "DEBUG", so that the string (A) is distinctly grep-able before committing code and (B) if it somehow ends up in production it's not totally mysterious.
I often use my initials and "DEBUG", so that the string (A) is distinctly grep-able before committing code and (B) if it somehow ends up in production it's not totally mysterious.
I once heard a guy — named Ed — who responded to a query about something with, "Well, I'm special." You can guess how he was referred to from then on ....
As in "MYNAME: " prefixed to whatever useful information I might need.
If you use language expressions that automatically become file/line info, that frees you from juggling unique labels. Then it can be saved into your IDE as a insertable code snippet.
It goes without saying that a real interactive debugger session is even better, but it isn't always convenient or possible.
(licenseActive = true) != true
I still remember the first time that happened to me, I think it had to do with some (not yet diagnosed) race condition on a PHP server between the HTTP requests it served, and the debugger had a side-effect of blocking the next request while I was inspecting the first one.
That reminds me of another thing: Some debuggers allow you to set breakpoints and set them to not suspend or pause execution, but to emits a log-message to the debugger or terminal instead.
Those are an upgrade over print-statements in that:
1. You can't accidentally commit it and it doesn't show up to make your diffs weird
2. You may be able to dynamically change what things it prints out without restarting the program