Things to do when you are stuck at a technical problem

TLDR;
1. Google it!
2. Read the documentation
3. Search on Stack Overflow
4. Do nothing (consciously)
5. Explain the problem to your friend
6. Step Back, Think Again
7. Write an email / blog about it.
8. Throw money at it

Every now and then I get stuck at a problem which makes me pull my hair. I eventually get it, but after wasting a lot of time trying just one thing and not quickly switching to an alternative. I wish I could remind myself this each time I was stuck.
So here’s list of things to do whenever you are stuck at a problem.

1. Google it!
Chances are that others are plagued with the same problem as you, and someone out there has written a solution to the problem. And assuming you are expert at finding stuff (if you are an engineer, then you probably are!) you will likely find it in the first attempt. If you dont, try changing the search keywords to “What you would title the blog post if you were writing the solution”. Remove dependent specifics (such as file path, line numbers or literals), and put other specifics such as “error code” or “error message” first with the name of the technology (such as android, c++, node js, etc.)
The success of this option depends more on chance than your Googling skills, but its still worth the time it takes (next to none, I know!). And often you will find a solution, only to realize that it doesn’t work in your case. At this time you can think more about how the author solved the problem and try to apply it to your case or email the author asking for help. They usually reply if you ask politely.
Also, if this is a quick question, ask it on SO.

2. Read the documentation
This is the option we try to avoid the most. Who wants to read 10 pages about how to do socket programming in C++, lets just Google an example, download and run it. And then sit and curse the author at the first error.
So here’s the truth. You have to read the documentation. It says exactly how to use a thing. Here’s the stuff author wanted you to know before you begin using his tools/library/code. So sweat it out and read it.
P.S. Don’t give up on this option until you are absolutely sure you have read it and it doesn’t address your problems.

3. Search Stack Overflow
So Google Search returned nothing, and the documentation didn’t help, it probably makes sense to search for similar problems on stack overflow. Use tags to find similar problems on SO. Good answers on SO, don’t just give away the answer, they also explain why the problem occurred and Why the solution works. This could probably give you a hint or increase your understanding of the problem. You can do this on your other favorite QnA sites too.

4. Do nothing (consciously)
Take a break. Have a cup of coffee. Go for a long walk. Take a shower. Meditate / Pray. Whatever suits you and is appropriate at the time of the day. Do something that calms you down and you don’t consciously think about the problem. While you are doing your thing, your sub conscious mind is working at the problem in the background. Chances are you will get new ideas. When you do get them, write them down.
This option helps when you have multiple things to do (like in college). Spend some time on a problem and if stuck, move to something else. Come back to it the later that day (or next day) and you will have a few new ideas to try out.

5. Explain the problem to your friend
The first three methods focused on solving the ‘Lack of information’ problem. But may be, you are stuck at a logic problem and you just need clarity of thought. Or you just need a different perspective. So find your buddy, and explain to him the problem you are facing and what you have done. Chances are either he can provide a fix to your problem or give you new ideas to try out.

6. Step Back, Think Again
Ask yourself why you wanted to do it in the first place ? Can you do away with it? Can you change some of the requirements (technical / non-technical) ? Step back a bit and look at it from a different perspective. May be, its not intended to work this way. May be you are using the wrong tools / language to solve the problem.

7. Write an email / blog about it / ask on Stack Overflow
At this point, you have exhausted most of the sources. You must be ready to apply considerable effort to solve it now.
Document the problem in an email to the author of the code / library, or blog about it or ask on SO. Write down what your understanding of the problem is and what you have done to solve it. Note down any assumptions. If uploading a code sample, make sure to create a Short, Self Contained, Concise (Compilable), Example . Doing this will give you a clarity of thought as well as throw the problem out in the open for people to see and easily try out. Update the post, as and when you try out new things or see different results. Keep an eye out for replies / comments and add more information to it as requested.

8. Throw money at it
At this point, you have spend a few days (at least) trying to solve the problem. If you are still getting no where with it and have the financial resources, put the problem on a job site like freelancer.com or elance.com. There are good chances that some experts in the field would be willing to solve the problem for you for a fee. Or by chance if you don’t get any “bids” you can say for sure that the problem cannot be solved.

Happy Coding!

Leave a comment