Thread: The end of an Era

  1. #1
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195

    The end of an Era

    Woe is me, for the first time today I actually encountered a problem with some code for which I had to result to running the debugger. After 28 years of programming without once resorting to the debugger, I now hang my head in shame :cry:

    On the up side I like the 2005 debugger better than 6.0

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >After 28 years of programming without once resorting to the debugger
    ...you finally started writing something non-trivial?
    My best code is written with the delete key.

  3. #3
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    Quote Originally Posted by Prelude View Post
    ...you finally started writing something non-trivial?
    Roomba's aren't going to program themselves

  4. #4
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by abachler View Post
    Woe is me, for the first time today I actually encountered a problem with some code for which I had to result to running the debugger. After 28 years of programming without once resorting to the debugger, I now hang my head in shame :cry:
    If I can't spot a problem within 10 minutes by inspection I usually just go straight to the debugger. Adding print statements is a much slower cycle because the code takes about 3 minutes to link. 3 minute turnaround just to add some debug prints sucks.

    If I was working with a smaller, nimbler codebase I'd probably just use print statements for a lot of things.

    Debugger hardware watchpoints are great for playing the "Who the hell changed the value in this variable" game.

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Does anyone follow the "test first" principle of extreme programming? It seems to me that such an approach would rarely require the use of a debugger since the currently failing test would immediately show the source the problem.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #6
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by laserlight View Post
    Does anyone follow the "test first" principle of extreme programming? It seems to me that such an approach would rarely require the use of a debugger since the currently failing test would immediately show the source the problem.
    That would be true if testing was guaranteed to find all errors. Then, you could actually assume that if Build 10 is good, and Build 11 is bad, then an error was introduced somewhere between Build 10 and Build 11.

    In reality, the error may have been introduced back in Build 8, was not uncovered during testing, and now some benign change between Build 10 and Build 11 has caused it to "wake up."

    Continual testing is, of course, a given. But passing tests doesn't prove you have a working product

  7. #7
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> After 28 years of programming without once resorting to the debugger
    Wow, I almost never run my program except through the debugger. How long do you take to find the causes of bugs if you do it by looking at code?

  8. #8
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    >> On the up side I like the 2005 debugger better than 6.0
    Er... when did you use the other one? LIAR!
    I have yet to use it... though I think it's a-la Prelude's response.

    >> How long do you take to find the causes of bugs if you do it by looking at code?
    I generally don't program bugs into my code

  9. #9
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    That would be true if testing was guaranteed to find all errors. Then, you could actually assume that if Build 10 is good, and Build 11 is bad, then an error was introduced somewhere between Build 10 and Build 11.

    In reality, the error may have been introduced back in Build 8, was not uncovered during testing, and now some benign change between Build 10 and Build 11 has caused it to "wake up."
    Ah, that makes sense.

    I generally don't program bugs into my code
    I have seen this quote attributed to Dijkstra: "If debugging is the process of removing bugs, then programming must be the process of putting them in."
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  10. #10
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> I generally don't program bugs into my code

    I take pride in the fact that my code only generates a hundred or so bugs per feature. I don't think it's humanly possible to code in our app without creating one.

  11. #11
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Daved View Post
    Wow, I almost never run my program except through the debugger. How long do you take to find the causes of bugs if you do it by looking at code?
    I find that sometimes, using a debugger seems to make my brain shut off. I've wasted hours tracing through code where I SWORE the problem was, only to find the error just by stepping back and spending 15 seconds actually thinking about it.

    The other technique I use is to speak to the photograph of my son which sits on my desk. I try to explain the problem to him. Usually when I do this the solution occurs to me. Thanks little guy!

  12. #12
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    My kid has a look on her face that says, "Seriously? You're seriously looking at me for help? Have you seen that code? Good luck buddy." Needless to say that doesn't help.

  13. #13
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    God, nobody has a sense of humour anymore. Sure I've programmed bugs into my code. But nothing that needed going to the debugger.

    >> my code only generates a hundred or so bugs per feature
    That's going in my signature. You mind? I understand what you mean, of course, but taken out of context that is very funny!

    I have no kids. Most of my bugs are from me not thinking about something right.
    Last edited by twomers; 11-06-2007 at 01:29 PM.

  14. #14
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> God, nobody has a sense of humour anymore.
    I think everybody understands you weren't being serious. Either that or you really work on some trivial programs, like write a program that maybe compiles and maybe doesn't, but doesn't do anything. It'd be hard to unintentionally create a bug for that one.

    >> That's going in my signature. You mind?
    You should use the whole line. I take pride in that fact. We're currently on bug #13000, and we reset to 1 several years ago.

  15. #15
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    >> You should use the whole line.
    There is that. Links to the quote though. I'm kinda going for people reading it out of context. Not running a program is a good way not to have any bugs alright.

    >> I think everybody understands you weren't being serious.
    Yeah. I know. But no acknowledgment? What kind of world is this?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. Modify to make Doubly Linked List
    By Dampecram in forum C Programming
    Replies: 10
    Last Post: 11-03-2008, 07:25 PM
  3. singly linked to doubly linked
    By jsbeckton in forum C Programming
    Replies: 10
    Last Post: 11-06-2005, 07:47 PM
  4. socket newbie, losing a few chars from server to client
    By registering in forum Linux Programming
    Replies: 2
    Last Post: 06-07-2003, 11:48 AM
  5. Next Question...
    By Azmeos in forum C++ Programming
    Replies: 3
    Last Post: 06-06-2003, 02:40 PM