![]() |
Programmers what do you name your debugs?
I actually inherited a convention that when I am throwing a debug statement in to stop my code -I call it "wanka".
This I inherited from a project manager at my old workplace (fujitsu) where our test environment was tcl (script language) based. If you pass the single line "wanka" into the code -the script will stop right there. So now that I am running VB I am still using wanka but now I am declaring it as a boolean. wanka = True if wanka then.... (set breakpoint however) ------------ I guess this is all extraneous stuff. I have the hardest time naming variables meaningfully. I guess I was wondering what you guys name your debugging variables? |
I generally write scripts to cough up a bunch of debugging information if a particular variable is set as a flag. I name that variable the unimaginative-but-non-comment-requiring "$debug".
|
It is usually better to make your code readable rather than funny. If I saw that "if wanka" it would cause me to have to look up wtf that does. Now if it said "if $debug" that explains what it does and another programmer looking at the code will instantly understand it.
I write code in C and C++ so I tend to use macros which can be compiled away to nothing if PRINT_DEBUG is set to 0. So my code tends to looks like this: int ape = 1; int pimp = MakeChimp(ape); DbgPrint("The value of pimp:%d, ape:%d", pimp, ape); |
When testing low-level server code, I'm usually verifying exception cases which shouldn't easily be reached, and I output something like "HOLY SHIT, BATBOY!~!!" so that it sticks out obviously in my trace (hundreds of lines of logging garbage) that the exception was triggered.
The important part is remembering to disable the exception output after I'm done. |
Some of the coders from a company I used to work for did that on a version of the client they released. They forgot to take the debug statement out so if you did a certain sequence of events a message box would pop up and it just said "gas".
|
All times are GMT -8. The time now is 01:35 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project