Knowing Where to Look: How to Find Answers to Programming Questions

Mihai Chelaru-Centea

Dec. 5, 2018


Too often I'm surprised at the lack of research that goes into a lot of the questions posted on Stack Overflow. It's clear that a lot of beginner programmers, and some who are more experienced, don't put in the effort to look in the most obvious places first before posting a sometimes lengthy question requesting help. Many of the questions I've answered on there have nothing to do with my expertise with a particular language or framework, but my ability to go to the right source and understand what that source says.

The first step is almost always Google, as often it will turn up the other sources that I turn to next on the first search. If it's a particular error message or exception I'm looking for the solution to, then I search for whatever the error text is, minus any variable names or things that are likely to be specific to my implementation. Usually I'll get some Stack Overflow results, or if it's from a specific library then I might also get some GitHub issue threads where people discuss the issue with the developers. This is usually only the case for well-maintained, popular libraries.

If I don't find the answer I'm looking for on the first page or two of Google, then I try to search through Stack Overflow to see if there are some more obscure questions with an answer to my problems. This has often solved the problem for me, although it can sometimes take some digging, and even though there are countless questions about Django on there, for instance, the fact that often times people have their projects set up differently and very specific problems means that you won't always find the answer there.

If the problem is with a particular open-source library, then I go to the GitHub repo for that library and look through their FAQ or their issues. Sometimes people will report the exact issue you're having, and it might be something that got addressed in a later version of the library and patched out, so it's good to know if the problem is with your code or the library itself. I find searching through the issues themselves pretty difficult, however, and if the library is really popular then there will be a lot of issues to pore through.

Also the issues threads are not laid out as nicely as Stack Overflow, but usually the useful posts will have a large number of thumbs up or other emojis that indicate that others found that post useful. Look for those first and then maybe read through in detail on a second reading if you don't find what you're looking for right away.

Finally, if those sources all fail, I look at the actual documentation for the library. This should sometimes be the first step, if you know that you'll be able to find the answer, or it's part of documentation for a library you know well and you've just forgotten what values some of the parameters take. Reading documentation is difficult as a beginner, but it's a really important skill to cultivate and master, as it will really reduce the amount of time you spend searching for information and let you spend more time on the actual work you have to do.

So next time you have a problem, be sure to try these out first before you run off to Stack Overflow or your colleagues for help. It often takes people a while to give you a useful response, and people get annoyed if they see you haven't done your research first before asking for help.