04-08-2007, 09:32 PM | #1 (permalink) |
Apocalypse Nerd
|
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? |
04-11-2007, 10:48 AM | #3 (permalink) |
Crazy
|
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); Last edited by snicka; 04-11-2007 at 10:51 AM.. |
04-11-2007, 11:03 AM | #4 (permalink) |
Lover - Protector - Teacher
Location: Seattle, WA
|
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.
__________________
"I'm typing on a computer of science, which is being sent by science wires to a little science server where you can access it. I'm not typing on a computer of philosophy or religion or whatever other thing you think can be used to understand the universe because they're a poor substitute in the role of understanding the universe which exists independent from ourselves." - Willravel |
Tags |
debugs, programmers |
|
|