views:

363

answers:

10

The second part of that question is key. If you are one of a few programmers, and after banging your head on your keyboard for endless nights you can't figure something out, with no one else in your organization to ask, what do you do? Not having someone to ask has more to do with the fact that it would take too long to bring them up to speed to even have them assess the problem. Are these the instances where you have uncomfortable conversations with management and tell them a third-party contractor with more experience will be required?

+4  A: 

If it is programming question come to stack overflow :)

fmsf
+1  A: 

Some times if I can't come up with a solution it might be because I am headed the wrong path with my approach to solving the problem. It helps me a great deal to not think about the problem for a little bit. Coming back to it after a break can give one fresh insight that might help find a solution.

neesh
+11  A: 

There is a time and place when everybody hits a problem where there doesn't seem an obvious way out.

1) Ask yourself if you are the first person ever to solve this - if not, then there is likely to be an answer out there. Try Google, SO etc.

2) Take a break and try and do something else for a while - it's amazing what a few hours away from the keyboard and thinking about something else can do.

3) Try talking about the problem to someone else, even if they aren't technical - sometimes the process of explaining a problem to someone who isn't technical or involved can lead you to the right answer or an approach from a different angle.

4) Admit it's harder than you had envisaged or you are stuck. A good boss will help you get to the right outcome, for both you and their business. Make them aware of the effort put in and the conclusions and decisions you've made to date.

5) If all else fails, help your boss choose the contractor as you'll probably have to maintain their code :-)

Miles D
#3 definitely is key. It will help clarify just where you stand on your understanding of the problem.
bruceatk
Agreed. My wife doesn't know a lick of programming, but she's been invaluable many times in helping me solve programming problems.
SnOrfus
+1  A: 

Depending on the problem sometimes I develop one-off apps to test/work with that particular feature/bug/whatever without all of the other pre-conditions and dependencies that exist in the project (and could be affecting the result).

Try redefining the problem. Sometimes you can rework the software you're writing so that you don't encounter the problem that you're trying to solve. Somtimes it's not a problem with your solution, but instead the state of the software that you're trying to implement it in.

SnOrfus
+1  A: 

First I google
And if that doesn't help I try to split the problem into parts I can solve. Usually the insight I get doing those parts will enlighten me sufficiently so I can take a new stab at the difficult part.

Nifle
+4  A: 

My favorite is rubber ducky debugging, explained here: http://lists.ethernal.org/oldarchives/cantlug-0211/msg00174.html

We called it the Rubber Duck method of debugging. It goes like this:

1) Beg, borrow, steal, buy, fabricate or otherwise obtain a rubber duck
(bathtub variety)

2) Place rubber duck on desk and inform it you are just going to go over some code with it, if that's all right.

3) Explain to the duck what you code is supposed to do, and then go into detail and explain things line by line

4) At some point you will tell the duck what you are doing next and then realise that that is not in fact what you are actually doing. The duck will sit there serenely, happy in the knowledge that it has helped you on your way.

Works every time. Actually, if you don't have a rubber duck you could at a pinch ask a fellow programmer or engineer to sit in.

Andy

Matt Rogish
A: 

If you can't explain it to your grandma' then you don't know what you're doing. Explaining some stuff to my girl (not technical savvy at all) helps a lot, even if she doesn't give me any feedback.

Ubersoldat
A: 

I faced this situation for an entire project in which I was the only programmer on the job, responsible for architecture all the way down to maintenance.

I dealt with it by aggressive use of Google and programming Q&A sites, though I didn't have SO at the time (resorted to Yahoo! Answers a couple of times). Most of the time I wouldn't find exactly what I needed, and I had to use my brain and do some hard-core trouble-shooting to solve most problems.

When you get absolutely stuck behind a brick wall, you need to come up with workarounds that are satisfactory for your end users. Chances are you won't be able to make everything work by sheer force of programming.

I agree with another answer here that sometimes getting up and walking away from a problem will often provide you with flashes of insight that would never occur to you while you're behind the keyboard. I have often had my most brilliant ideas come to me while driving or in the shower.

moffdub
A: 

9 times out of 10 if you google it you find the answer or get a good idea of how to proceed. Also taking it out to yourself helps ENORMOuUSLY, sometimes even better than googling

klyde
+1  A: 

I like to start working on the easiest bits first. So what if you can't figure out how to find the optimised path algorithm in your map? Just start by writing the flood-fill drawing code. Then do the AI routines for combat, after all they need to get done as well. Then while you are working on the weather simulator, you will realise that your subconscious has been working out the details for the pathing algorithm while you slept.

1800 INFORMATION