View Poll Results: Were you taught how to debug code at college/university?
- Voters
- 39. You may not vote on this poll
-
What's debugging?
-
No.
-
Some help was given.
-
Yes, it was part of the course.
-
Not applicable, self taught programmer
-
September 16th, 2009, 07:05 AM
#61
Re: Were you taught debugging
The worst case is this: I remember a few months ago I was writing a small app for someone, it ran fine 99% of the time, but crashed 1% of the time. In one thread, and it never ever happened when the debugger was running. That one took 3 days to figure out. Turns out I was double deleting a pointer.
-
September 16th, 2009, 07:27 AM
#62
Re: Were you taught debugging
Originally Posted by Ayyubid
why call it a bug?
"hey chris, this line is bugging me" -1940
http://catb.org/jargon/html/B/bug.html
-
September 16th, 2009, 09:55 AM
#63
Re: Were you taught debugging
Originally Posted by Rich2189
It is not wise to use message boxes for printing results; in the unfortunate event you do get stuck in an infinite loop you're stuffed.
Most of us here will be good enough to avoid infinite loop situations but they do happen from time to time. Most of all it isn't a good technique to show new programmers.
The debug output windows is the way to go for such messages.
You'll notice it was last in my list because it's basically a last resort type of tactic. In this scenario, you might have access to the source for modification, but can't run the debugger in production. Debug output is only good for a debug build and (besides when debugging in a debugger) when running an external debug capture tool such as dbgview. You may only be able to run a release build without the ability to spew debug output.
As far as infinite loop - having a message box inside an infinite loop isn't going to cause any more trouble than an infinite loop without a message box. At any rate, if this occurs you can always just kill the app.
As I said, peppering the code with message boxes is a valid debugging technique - it's just not one that I would use if I had other options.
-
September 16th, 2009, 12:02 PM
#64
Re: Were you taught debugging
Originally Posted by Arjay
You'll notice it was last in my list because it's basically a last resort type of tactic. In this scenario, you might have access to the source for modification, but can't run the debugger in production. Debug output is only good for a debug build and (besides when debugging in a debugger) when running an external debug capture tool such as dbgview. You may only be able to run a release build without the ability to spew debug output.
Good point.
Originally Posted by Arjay
As I said, peppering the code with message boxes is a valid debugging technique - it's just not one that I would use if I had other options.
Agreed, not the best.
Rich
Visual Studio 2010 Professional | Windows 7 (x64)
Ubuntu
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|