CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

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?

    1 2.56%
  • No.

    17 43.59%
  • Some help was given.

    9 23.08%
  • Yes, it was part of the course.

    0 0%
  • Not applicable, self taught programmer

    12 30.77%
Page 5 of 5 FirstFirst ... 2345
Results 61 to 64 of 64
  1. #61
    Join Date
    Jan 2009
    Posts
    1,689

    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.

  2. #62
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Were you taught debugging

    Quote Originally Posted by Ayyubid View Post
    why call it a bug?

    "hey chris, this line is bugging me" -1940
    http://catb.org/jargon/html/B/bug.html

  3. #63
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Were you taught debugging

    Quote Originally Posted by Rich2189 View Post
    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.

  4. #64
    Join Date
    Oct 2005
    Location
    England
    Posts
    803

    Re: Were you taught debugging

    Quote Originally Posted by Arjay View Post
    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.

    Quote Originally Posted by Arjay View Post
    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

Page 5 of 5 FirstFirst ... 2345

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured