News for hackers. Stuff that matters.
Re:Why HN was down by DanielBMarkham on Monday February 18, 2013 @01:39PM (#5239758)
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

Re:Why HN was down by davesims on Monday February 18, 2013 @02:00PM (#5239915)
A 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."

Re:Why HN was down by confluence on Monday February 18, 2013 @05:26PM (#5241176)
I 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.

Re:Why HN was down by bbrizzi on Tuesday February 19, 2013 @04:07AM (#5243390)
When 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.
Re:Why HN was down by restlessmedia on Tuesday February 19, 2013 @04:26AM (#5243436)
I'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.
Re:Why HN was down by junto on Tuesday February 19, 2013 @08:12AM (#5244038)
I also feel guilty when I do this, but at least the answer helps others who might have the same question.
Re:Why HN was down by autotravis on Tuesday February 19, 2013 @01:25PM (#5246025)
I think stackoverflow encourages[1] this, so no need to feel guilty.

1. http://blog.stackoverflow.com/2011/07/its-ok-to-ask-and-answ...

Re:Why HN was down by troebr on Tuesday February 19, 2013 @10:46AM (#5244840)
Haha, we called it the House method too, we ended up making a cardboard humanoid for when nobody was available.
Re:Why HN was down by kamjam on Monday February 18, 2013 @03:53PM (#5240567)
This 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 :)

Re:Why HN was down by cientifico on Monday February 18, 2013 @04:29PM (#5240792)
Maybe because the solution is in asking the good questions.
Re:Why HN was down by kamjam on Monday February 18, 2013 @04:57PM (#5241002)
Yup, 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.
Re:Why HN was down by jsmeaton on Monday February 18, 2013 @04:09PM (#5240655)
On 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.
Re:Why HN was down by kyrias on Monday February 18, 2013 @04:28PM (#5240781)
You should consider submitting the question and answering it yourself, might help someone else.
Re:Why HN was down by Brandon0 on Monday February 18, 2013 @06:29PM (#5241548)
I 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.
Re:Why HN was down by hfsktr on Monday February 18, 2013 @06:55PM (#5241660)
I 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.

Re:Why HN was down by tekromancr on Tuesday February 19, 2013 @12:02AM (#5242737)
Just 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.
Re:Why HN was down by danohuiginn on Tuesday February 19, 2013 @04:17AM (#5243412)
I 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.
Re:Why HN was down by tekromancr on Tuesday February 19, 2013 @05:17AM (#5243562)
What 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?

Re:Why HN was down by enjo on Monday February 18, 2013 @08:35PM (#5242063)
I 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.

Re:Why HN was down by lemming on Monday February 18, 2013 @06:44PM (#5241621)
Amusingly, IntelliJ has a plugin to do exactly this:

https://sites.google.com/site/codeconsultantplugin

Re:Why HN was down by davesims on Monday February 18, 2013 @07:37PM (#5241815)
That'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.
Re:Why HN was down by Swizec on Monday February 18, 2013 @04:06PM (#5240635)
Working from home I tend to just write out my thoughts on a piece of paper. It works perfectly.
Re:Why HN was down by timv on Monday February 18, 2013 @05:12PM (#5241084)
When 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 :)

Re:Why HN was down by pseut on Monday February 18, 2013 @04:39PM (#5240879)
I 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...)
Re:Why HN was down by z-e-r-o on Monday February 18, 2013 @02:02PM (#5239925)
For 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.
Re:Why HN was down by Semaphor on Monday February 18, 2013 @02:13PM (#5240007)
That 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.
Re:Why HN was down by confluence on Monday February 18, 2013 @05:30PM (#5241193)
I'm a serial SO self-answerer. I write really in depth, complicated questions for complicated problems, with code, data and testable cases - and by the time I've finished the question and posted it - I've figured out the solution - or I'll have it a few hours later.

I usually just leave the question/answer online so that others can benefit for it.

Re:Why HN was down by robotic on Monday February 18, 2013 @03:31PM (#5240446)
I've made several posts to SO and then realize the answer moments later. I usually just self-answer.
Re:Why HN was down by elcodedocle on Monday February 18, 2013 @03:05PM (#5240302)
Same 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...)
Re:Why HN was down by aroman on Monday February 18, 2013 @02:07PM (#5239963)
Likewise for me, but with IRC. Though I suppose I should try asking on SO first to save myself the semi-public embarrassment ;)
Re:Why HN was down by s_baby on Monday February 18, 2013 @05:17PM (#5241115)
Yup, 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.
Re:Why HN was down by furyofantares on Monday February 18, 2013 @01:54PM (#5239878)
There 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?

Re:Why HN was down by mhurron on Monday February 18, 2013 @03:11PM (#5240330)
Extremely appropriate as Fry is his own grandfather and the site software can't handle that relationship.
Re:Why HN was down by Aardwolf on Monday February 18, 2013 @03:23PM (#5240396)
That's one of my favorite lines from Futurama, 'Ohh, a lesson in not changing history from Mr. "I'm My Own Grandfather"!'
Re:Why HN was down by robinh on Monday February 18, 2013 @04:15PM (#5240689)
Curiously, that episode was on TV where I live just an hour ago.
Re:Why HN was down by brehaut on Monday February 18, 2013 @05:02PM (#5241033)
Re:Why HN was down by robinh on Monday February 18, 2013 @05:22PM (#5241154)
Oh, I know. Just wondered if the person who posted the comment above mine had just seen that particular episode, too.
Re:Why HN was down by banachtarski on Monday February 18, 2013 @02:23PM (#5240081)
Is this the forward time machine episode??

I love futurama more than any man could love any tv show.

Re:Why HN was down by short_circut on Monday February 18, 2013 @02:55PM (#5240241)
I feel like your name reflects that fact. It seems to be a reference to the Banach-Tarski duplashrinker
Re:Why HN was down by ztravis on Monday February 18, 2013 @03:34PM (#5240461)
More likely it is a reference to its eponym, the Banach-Tarski paradox.
Re:Why HN was down by banachtarski on Monday February 18, 2013 @10:39PM (#5242456)
It's both :) I studied math too.
Re:Why HN was down by furyofantares on Monday February 18, 2013 @03:53PM (#5240563)
It is -- it's when they are observing the second big bang.
Re:Why HN was down by Someone on Monday February 18, 2013 @04:11PM (#5240673)
Amazing? for anyone who has read Polya's "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?)

Re:Why HN was down by biot on Monday February 18, 2013 @02:07PM (#5239958)
People 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.
Re:Why HN was down by kamjam on Monday February 18, 2013 @03:57PM (#5240589)
One 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!
Re:Why HN was down by 65a on Monday February 18, 2013 @03:51PM (#5240558)
Debugging 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.

Re:Why HN was down by hobs on Monday February 18, 2013 @10:23PM (#5242404)
This 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.
Re:Why HN was down by chii on Tuesday February 19, 2013 @06:14AM (#5243703)
i think perhaps some people just don't see the world in a hierarchical way, so in their frame of mind, the problem is intractable.
Re:Why HN was down by snowwrestler on Monday February 18, 2013 @11:07PM (#5242545)
It'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".
Re:Why HN was down by jgrahamc on Monday February 18, 2013 @01:49PM (#5239851)
The sort of debugging seems to have been around since the very beginning: http://blog.jgc.org/2010/05/talking-to-porgy.html
Re:Why HN was down by RyanMcGreal on Monday February 18, 2013 @02:01PM (#5239924)
I'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.)
Re:Why HN was down by chernevik on Monday February 18, 2013 @02:10PM (#5239984)
That'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."
Re:Why HN was down by RyanMcGreal on Monday February 18, 2013 @02:24PM (#5240086)
Good point. I was thinking in terms of going through the code line by line, which if anything would lead you away from the trail.
Re:Why HN was down by DanielBMarkham on Monday February 18, 2013 @02:09PM (#5239979)
Yep. 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)))

Re:Why HN was down by cube13 on Monday February 18, 2013 @02:14PM (#5240014)
Rubber duck debugging may have actually been the distraction that caused pg to make the mistake, too!
Re:Why HN was down by amorphid on Monday February 18, 2013 @03:27PM (#5240415)
This. 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.
Re:Why HN was down by mvzink on Monday February 18, 2013 @02:55PM (#5240238)
This is also why pair programming is so great.
Re:Why HN was down by ryen on Monday February 18, 2013 @03:49PM (#5240547)
Not easy on a Sunday while at home.