Aaarrgh~! Blowing off some steam...
I just spent 4+ hours staring at my code trying to find out why only half my game objects were being rendered.
Turns out I had ++i at the bottom of my for loop, causing i to increment twice.
;P
Just had to rant a little bit.
yckx
The debugger is your best friend. If you had stepped through the render loop and noticed that i was only being set to even numbers, I imagine it would have been a five minute task at worse.
Learning how to make effective use of a debugger is pretty much the most important thing you can do as a programmer, beyond learning the language. Debugging without a debugger is like fixing a watch without looking inside it as it runs.
Don''t listen to me. I''ve had too much coffee.
Learning how to make effective use of a debugger is pretty much the most important thing you can do as a programmer, beyond learning the language. Debugging without a debugger is like fixing a watch without looking inside it as it runs.
Don''t listen to me. I''ve had too much coffee.
If you don''t have a debugger handy, you can still step through your code by inserting code to wait for a keypress, and outputting whatever variables you''re interested in whenever seems appropriate. Though I did hear of one case where a manually debugging program kept crashing, and every time the guy tried moving his check code to some other part of the code, the crash behaviour changed. Eventually turned out there was a memory leak in his output routine
And, even with a debugger, it''s easy to overlook loop variables... be honest, how long would it have taken you to even think of checking the loop variable was behaving properly?
And, even with a debugger, it''s easy to overlook loop variables... be honest, how long would it have taken you to even think of checking the loop variable was behaving properly?
How do you debug in full screen mode? I didn''t know it was possible. Anyway I just write a TextLog function that helps me a little but not as much as a debugger would.
Yeah, it was the debugger that (indirectly) helped me find the problem, but I hadn''t really learned to use it before, so I was hesitant to play with it. Self-defeating philosophy, I know
All that time wasn''t just hunting around for errors, although a good bit of it was. A good bit of it was learning the debug basics, too. I was just caught up in the stress/relief of finding such a stupid bug that caused such eratic behavior, and pissed at myself for making such a mistake, and then not being able to see what should have been so obvious....
Oh, well. I''m recovering from surgery. There''s little else for me to do other than stare at code, anyway
yckx
All that time wasn''t just hunting around for errors, although a good bit of it was. A good bit of it was learning the debug basics, too. I was just caught up in the stress/relief of finding such a stupid bug that caused such eratic behavior, and pissed at myself for making such a mistake, and then not being able to see what should have been so obvious....
Oh, well. I''m recovering from surgery. There''s little else for me to do other than stare at code, anyway
yckx
quote: Original post by ph33r
How do you debug in full screen mode? I didn''t know it was possible. Anyway I just write a TextLog function that helps me a little but not as much as a debugger would.
I have an old vt100 terminal that I connect to my computer... I use gdb through it for debugging when I''m doing fullscreen stuff.
Before I had that, tho, I just got in the habit of NEVER breaking my apps with respect to lost devices, so that I could always alt-tab back and forth.
Don''t listen to me. I''ve had too much coffee.
Hm..I spent longer than that trying to figure out why my decompression algorithm bailed out..turned out to be a varaible declared as char instead of short..wasn''t easy to find out even with a debugger..
And about the fullscreen issue..I just put my apps in windowed mode when I need to debug them
-Luctus
Codito, Ergo Sum (Courtesy of ThinkGeek)
[Mail][DreggSoft][Fileformat Guide][n00bs]
And about the fullscreen issue..I just put my apps in windowed mode when I need to debug them
-Luctus
Codito, Ergo Sum (Courtesy of ThinkGeek)
[Mail][DreggSoft][Fileformat Guide][n00bs]
-LuctusIn the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move - Douglas Adams
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement