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 1 of 5 1234 ... LastLast
Results 1 to 15 of 64
  1. #1
    Join Date
    Jul 2002
    Location
    Portsmouth. United Kingdom
    Posts
    2,727

    Were you taught debugging

    Assuming you learnt programming in a formal situation, did debugging get taught in any significant way?
    "It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
    Richard P. Feynman

  2. #2
    Join Date
    Jun 2009
    Location
    France
    Posts
    2,513

    Re: Were you taught debugging

    Quote Originally Posted by JohnW@Wessex View Post
    Assuming you learnt programming in a formal situation, did debugging get taught in any significant way?
    Nope, I still don't really know how to do it much.

    I used to just cout my code all over to find out what was happening.
    I learned at work to investigate a core with the debugger (command line gdb).

    I should really learn how to debug a running program... a colleague kind of showed me once, but I forgot...

  3. #3
    Join Date
    Jul 2002
    Location
    Portsmouth. United Kingdom
    Posts
    2,727

    Re: Were you taught debugging

    Am I being a hopeless optimist in thinking that the What's debugging count will stay at zero?
    "It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
    Richard P. Feynman

  4. #4
    Join Date
    Jan 2009
    Posts
    1,689

    Re: Were you taught debugging

    Nope, we weren't taught how to use the debugger, actually, there was only one C++ course at the entire university. All the comp-sci courses were Java except for the graphics courses which were of course C. The one C++ class had a professor who really didn't know much about it. His idea of debugging was:

    Code:
    void method(void){
       //Some code
       cout << "Made it here" << endl;
       //Some more code;
       cout << "Made it here 2" << endl;
    }
    Useful for some things, but not most.
    Last edited by ninja9578; September 4th, 2009 at 08:43 AM.

  5. #5
    Join Date
    Jun 2006
    Location
    M31
    Posts
    885

    Re: Were you taught debugging

    Quote Originally Posted by JohnW@Wessex View Post
    Assuming you learnt programming in a formal situation, did debugging get taught in any significant way?
    Not really, no.

    Not even preventative measures (e.g., [static] assertions) were covered.

  6. #6
    Join Date
    Aug 2007
    Posts
    858

    Re: Were you taught debugging

    Only had one intro to C++ class that barely even covered the basics, but debugging wasn't mentioned.

  7. #7
    Join Date
    Jan 2006
    Location
    Belo Horizonte, Brazil
    Posts
    405

    Re: Were you taught debugging

    Interesting poll John.

    I believe that debugging should be part (or perhaps a parallel course) of a programming course in college. When reading the poll I first thought of marking *Some help was given*. Then, I realized that the correct answer in my case would be *No*.

    I did get some help, but it was really something like this: If you want to inspect variable values run your program line by line. Just hit FX instead of FY and place some "bullets" at the places you would like it to stop. Then hit FW to execute a particular statement.

    That's everything I was told about debugging at school. This is so far away from actually understanding how debugging works and all the help you can get from it that I decided to vote *No*. The worst part is that I know people that still think that debugging is just that.

    Debugging could be considered an art just as programming. We should be taught how the attachment process work, how symbols are generated, how to analyse the stack, how to analyse core dumps, memory layout, among others things. Also, debugging can be a very creative process when you have non-usual situations in which you can't inspect things easily or directly.

    I'm not an expert debugger. When possible, I try to learn things and work on it. But surely, school could have helped me better just like it did for writting code. Both subjects are important and complementary.

  8. #8
    Join Date
    Jul 2002
    Location
    Portsmouth. United Kingdom
    Posts
    2,727

    Re: Were you taught debugging

    It's not just learning how to use the debugger that's important (assuming the platform you're working on has one!) but also designing for debugging.
    On some embedded projects that I worked on many, many years ago, the software was compiled on a 286 MSDOS machine and blown into a ROM before it could be tested. Very early on I designed in a diagnostics port into all of the hardware so that I could plug in my debug box (LED display, switches, RS232 port) to get debugging information out.
    Nowadays I work on Windows based projects, but I still design in debugging. Now it comes in the form of compile time & run time asserts, logs and exceptions. All are built into the code from the very beginning.
    "It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
    Richard P. Feynman

  9. #9
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Were you taught debugging

    It wasn't covered extensively in my college-level classes, no. However, they did at least touch on it when I was at American Computer Experience summer camp on the BU campus, and in my high school APCS course.

    The real question is, were you taught how to use man pages?

  10. #10
    Join Date
    Jun 2009
    Location
    France
    Posts
    2,513

    Re: Were you taught debugging

    That said, could anybody point me to a good gdb debugger tutorial

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

    Re: Were you taught debugging

    You need another poll choice - something like:

    "Self taught programmer, but is proficient in debugging."

    Debugging is probably the most important skill a developer can, um, develop. It's not just being able to effectively use your debugger (whether it's integrated in an IDE or standalone), but also being able to set up the environment so that your program can be debugged.

    Too much time is wasted on ineffective debugging techniques like cout or putting in message boxes. In my opinion these should be a last resort over using more advanced debugging tools.

  12. #12
    Join Date
    Jan 2009
    Posts
    1,689

    Re: Were you taught debugging

    Quote Originally Posted by monarch_dodra View Post
    That said, could anybody point me to a good gdb debugger tutorial
    Most programmers use their IDE for debugging, which have wrappers around gdb. XCode's debugger is by far the best, but if you're on Windows, Code::Blocks has a nice interface to the debugger. Just take a look at the Debug menu, most of it is pretty self evident.

  13. #13
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Were you taught debugging

    Quote Originally Posted by Arjay View Post
    Too much time is wasted on ineffective debugging techniques like cout or putting in message boxes. In my opinion these should be a last resort over using more advanced debugging tools.
    In this day and age of interactive debuggers, it's incredulous (at least to me) that someone using, say Visual Studio, would have a problem with a relatively simple program and not be curious as to what the "Debug" menu item on the IDE is supposed to do. But in too many instances, you have posters not using their own initiative in figuring this out . I would expect this scenario -- "Debug menu item? Let's see, what does this do? Hey, look at this! I can see my program run under my control. That's cool". Nope, you get the "I never used the debugger" responses.

    When I was going to school, there were hardly any interactive terminals in schools, let alone interactive debuggers such as Visual Studio's or gdb. This was at the latter part of the punchcard era. In my case, you had to go through the code by hand to make sure the program was error-free. You would then hand your punch cards over to someone you didn't know in a room, and waited several hours for your output to appear on paper. Now given that scenario, you had to learn debugging very quickly or else you would never get your programs completed.

    Regards,

    Paul McKenzie

  14. #14
    Join Date
    Aug 2007
    Posts
    858

    Re: Were you taught debugging

    But in too many instances, you have posters not using their own initiative in figuring this out . I would expect this scenario -- "Debug menu item? Let's see, what does this do? Hey, look at this! I can see my program run under my control. That's cool". Nope, you get the "I never used the debugger" responses.
    This is really a general attitude issue towards using computers/technology. For a great many people the train of thought goes something more like "Debug menu? What does this do? Hm, I don't know what it is, better leave it alone - might break something".

    Even among professional programmers I've known more than a few people who were effectively novice computer users. They have their language(s) and suite of tools that they're familiar with and good at, but throw something different at them, take them out of their comfort zone, and they're completely hopeless without someone to hold their hand and guide them step by step.

  15. #15
    Join Date
    Sep 2009
    Posts
    18

    Re: Were you taught debugging

    One of my intro C++ classes had a special one-time session outside of class about using the debugger in Visual Studio. Being a stupid freshman I didn't go, and to this day I debug by planting couts everywhere. Gotta look into a tutorial one of these days.

Page 1 of 5 1234 ... LastLast

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