Re:Reasons To Give The Vim Text Editor A Chance
by dekz on Sunday May 15, 2011 @07:05PM
(#2551023)
The only downside to print statements is forgetting to remove them and having some obnoxious message committed.
[ Parent
| on HN ]
Re:Reasons To Give The Vim Text Editor A Chance
by angusgr on Sunday May 15, 2011 @08:08PM
(#2551165)
A useful trick we've had at previous workplaces which solves this (and related accidental-debug-code-checkin) problems is to put a precommit hook that denies a checkin with a certain string in the text (we used "DNCI" for Do Not Check In)
So you get in the habit of annotating test tweaks & debug prints with:
printf("DNCI x is %d\n", x);
I use gdb as well, but sometimes dumping data directly is all you really need.