8 ms·
Amazing that such a large percentage of debugging involves determining exactly what you are debugging. The definition of the problem, many times, is the solutio
by DanielBMarkham 14y ago
Amazing that such a large percentage of debugging involves determining exactly what you are debugging. The definition of the problem, many times, is the solution.
Might be a good time to mention Rubber Duck Debuggging. http://en.wikipedia.org/wiki/Rubber_duck_debugging http://en.wikipedia.org/wiki/Rubber_duck_debugging
- davesims 14y agoA few times a month, I'll look up at one of my colleagues and say, "hey, got a sec? I need to talk to the duck," and they know this means I'm going to talk to their head but they can basically keep doing what they're doing and nod occasionally. This serves several purposes: (1) It's less insane-sounding than actually talking to an inanimate object in an open work environment. (2) It actually feels better and forces me to think more clearly when I'm talking to an actual person -- the cognitive focus is higher when the object of conversation can actually, in theory, think and talk back (YMMV). (3) And finally, although it does require some focus on the part of the other coder, it's not nearly as taxing to them as actually helping me solve the problem or pairing up with me. So it's a good compromise somewhere between pair programming and talking to an actual rubber duck. Again, YMMV. Maybe I'll call it "Pair Ducking."
- kamjam 14y agoThis is so true, probably about 90% of the time my colleagues call me over about a problem they are facing, explain in detail what the problem is and then eureka! Most of the time it would actually take me much longer to figure out the exact issue since I don't know the ins/outs and subtleties of the code but it's exactly as you say. Of course, it makes me look really good cos I just "helped" them solve their issue :)
- cientifico 14y agoMaybe because the solution is in asking the good questions.
- kamjam 14y agoYup, for sure it is, sometimes just having someone else there and having to run through all the steps for them points out the obvious. There was another user further down that said he solved a lot of his own problem just typing them out with enough detail to be able to post on StackOverflow. Same principle.
- Swizec 14y agoWorking from home I tend to just write out my thoughts on a piece of paper. It works perfectly.
- pseut 14y agoI send myself an email for the same purpose and set up an alias for /dev/null. It makes keeping notes a lot easier since I have the copy in sent mail and can reply to it as needed in the future. (this approach seemed less crazy before I typed it out...)
- timv 14y agoWhen I work from home (and I did it exclusively for 8 months of last year) I ended up talking to my wife (my 1 yo daughter wouldn't stand still for long enough). My wife is a social worker by training, so it was pretty rare (though not unheard of) for her to be able to give me real input, but over the years I've trained her well enough to follow most of what I'm saying and nod at the right points :)
- jsmeaton 14y agoOn occasion, I'll write a question on stackoverflow and re-read it a few times before hitting submit just in case I get that eureka moment. I think I've written way more non-submitted questions than submitted questions.
- Brandon0 14y agoI do this a lot too. In fact more often than not I end up not posting the question because either I solve the problem or I think of a possible solution I should go try first. I think we should start calling it Digital Rubber Ducking.
- hfsktr 14y agoI am looking for an excuse to make digitalrubberduck(y/ie).com If I was a bit more clever I feel like there is a use there.
- tekromancr 14y agoJust make a programming themed chatterbot,drop some ads (If you are so inclined), and you are golden! Someone posted a plugin for IntelliJ that allows you to do just that. I would use a web based one of it existed.
- danohuiginn 14y agoI have occasionally used eliza for this (the basic chatbot in emacs and elsewhere). I'm sure with a bit of tuning you could make a debugging-centred variant of it.
- tekromancr 14y agoWhat do the Unit Tests say? Have you tried running a debugger and stepping through the code? Hmm, go on. Wait a sec, can you reexplain that last bit?
- 14y ago
- confluence 14y agoI call it the House method :) You bring a detailed problem and break it down, and talk about it to someone else (who often isn't qualified to answer your questions due to knowledge/time constraints) - and in doing so - resolve the problem by challenging one's own assumptions. This was effectively how every House episode was resolved.
- bbrizzi 14y agoWhen I'm stuck on a problem for way too long, I start typing it out in Stack Overflow. Usually by the time I'm done describing it, I've already solved it.
- restlessmedia 14y agoI've lost count the amount of times I've done that. Also, I'm probably the top of the pops in answer replies to my own questions.
- junto 14y agoI also feel guilty when I do this, but at least the answer helps others who might have the same question.
- autotravis 14y agoI think stackoverflow encourages[1] this, so no need to feel guilty. 1. http://blog.stackoverflow.com/2011/07/its-ok-to-ask-and-answer-your-own-questions/ http://blog.stackoverflow.com/2011/07/its-ok-to-ask-and-answ...
- troebr 14y agoHaha, we called it the House method too, we ended up making a cardboard humanoid for when nobody was available.
- lemming 14y agoAmusingly, IntelliJ has a plugin to do exactly this: https://sites.google.com/site/codeconsultantplugin https://sites.google.com/site/codeconsultantplugin
- davesims 14y agoThat's fantastic. I use IntelliJ for Android stuff, installing now. They should add a 'Duck' mode that just brings up a big picture of the rubber duck.
- enjo 14y agoI have a whiteboard in a closet I use for this... seriously...I go in there and start jotting down notes and talking to myself. It fascinates me how quickly I usually find the answer.
- RyanMcGreal 14y agoI'm not sure if rubber duck debugging would have helped here. The problem was in the data, not the code. (I know, I know: in Lisp code is data.)
- DanielBMarkham 14y agoYep. I thought this through as I was typing my comment. (There must be some joke involving the use of a meta-duck, but I can't come up with it. :) (Same principle applies, of course, just LISP makes the determining of "what" a bit more tricky. (insert discussion here about the general differences between debugging imperative and functional code)))
- chernevik 14y agoThat's exactly the sort of thing a duck will tell you. "So what has changed? Let's see, new code, new server, and I fixed the commenter's comment. That was simple I just hard-hacked the comment id and . . . excuse me a second."
- RyanMcGreal 14y agoGood point. I was thinking in terms of going through the code line by line, which if anything would lead you away from the trail.
- cube13 14y agoRubber duck debugging may have actually been the distraction that caused pg to make the mistake, too!
- z-e-r-o 14y agoFor me, this should be called stackoverflow debugging. I genuinely solved a lot of my problems by trying to write a _good_ question on SO about my problem. The problem seems really difficult when I try to ask it in one sentence, just out of my head. However once I try to describe the background, what I'm trying to achieve, what I'm using, when does the problem happen, simplified down to sub-cases, usually by the time I'd be 80% ready with writing the question, I realize the answer.
- aroman 14y agoLikewise for me, but with IRC. Though I suppose I should try asking on SO first to save myself the semi-public embarrassment ;)
- Semaphor 14y agoThat happens to me a lot. Most of the time I just formulate the question I have in my head into something coherent and by that point I either have the solution, know what to search for or, in case it's not a question but a comment, I realize it's not worth saying.
- deleted 14y ago[deleted]
- elcodedocle 14y agoSame here: I've been working on a couple of projects by myself for the most part of last year, and when even the duck failed, I could usually figure out an answer just by trying to find the words to post my problem in SO in a way somebody would take the time to read it and be able to answer it. I don't recommend it as a first approach, though, since it's quite time consuming (Or maybe I should blame it on not being a native speaker...)
- robotic 14y agoI've made several posts to SO and then realize the answer moments later. I usually just self-answer.
- s_baby 14y agoYup, the incentive is there to state your problem as clearly as possible to get back a good response. By doing this I answer my own question half of the time.
- biot 14y agoPeople at work are amazed when I successfully debug an issue over the phone. In reality, it amounts to 50% experience plus another 50% of Sherlock Holmes: "When you have eliminated the impossible, whatever remains, however improbable, must be the truth". Once you've identified what you're dealing with via a few strategic questions, it becomes simple quite rapidly.
- 65a 14y agoDebugging is often best accomplished as a binary tree search aimed by familiarity/experience. Once you can put bounds on the search, it becomes possible to get the answer in just a few questions. Totally agree.
- hobs 14y agoThis is the best way to work through debugging/troubleshooting as far as I can tell, amazingly a skill many people lack, and others that just understand it intuitively without it ever thinking about it. That is one of the big divisions between hackers and everyone else in my mind.
- chii 14y agoi think perhaps some people just don't see the world in a hierarchical way, so in their frame of mind, the problem is intractable.
- kamjam 14y agoOne of my favourite debugging tips has always been "give everyone full access to the folder/service" and see if the problem is "fixed". If so revert and now apply the correct permissions. I've seen this come up so many times although my superiors always complained "it's not the right way to do it", whilst I agree "every full access" is bad, this was for debugging purposes only!
- snowwrestler 14y agoIt's amazing how often I am able to fix problems by simply trying all the possible solutions--often while colleagues are saying things like "stop wasting time, it can't possibly be that." But of course often it is "that".
- jgrahamc 14y agoThe sort of debugging seems to have been around since the very beginning: http://blog.jgc.org/2010/05/talking-to-porgy.html http://blog.jgc.org/2010/05/talking-to-porgy.html
- furyofantares 14y agoThere is a line from Futurama that perfectly applies ton a lot of debugging. Farnsworth: My God, is it really possible? Fry: It must be possible, it's happening. Fry: By the way, what's happening?
- banachtarski 14y agoIs this the forward time machine episode?? I love futurama more than any man could love any tv show.
- short_circut 14y agoI feel like your name reflects that fact. It seems to be a reference to the Banach-Tarski duplashrinker
- ztravis 14y agoMore likely it is a reference to its eponym, the Banach-Tarski paradox.
- banachtarski 14y agoIt's both :) I studied math too.
- furyofantares 14y agoIt is -- it's when they are observing the second big bang.
- mhurron 14y agoExtremely appropriate as Fry is his own grandfather and the site software can't handle that relationship.
- Aardwolf 14y agoThat's one of my favorite lines from Futurama, 'Ohh, a lesson in not changing history from Mr. "I'm My Own Grandfather"!'
- mvzink 14y agoThis is also why pair programming is so great.
- ryen 14y agoNot easy on a Sunday while at home.
- amorphid 14y agoThis. Even with the best test coverage in the world, you still bump into edge cases that you couldn't have predicted. As a former QA Engineer, I used to say there's still room for QA in a test driven environment. Now I say there's no replacement for a sharp mind with enough knowledge, curiosity, and good judgement.
- Someone 14y agoAmazing? for anyone who has read Polya's "how to solve it" (http://en.wikipedia.org/wiki/How_to_Solve_It http://en.wikipedia.org/wiki/How_to_Solve_It), that is hardly surprising. If you don't understand your problem, you can't make a plan. If you can't make a plan, you can't execute it. Another interesting lesson from that book is that one should spend time on evaluation (how did this come about? Could We have fixed this sooner? How are we going to prevent it in the future?)