Headshot Jeremy Gagon

Jeremy Gagon

Web Developer

The greatest mistake you can make in life is continually fearing that you'll make one.

Elbert Hubbard

Questioning Questioning

What Makes a Good Question?

February 1, 2015

Given the size and complexity of the information you need to know to write code, it’s likely that you will have questions. There is simply too much information for a single person to know everything.

Fortunately, developers are more than willing to share information and offer insights. There is a true spirit of community and helpfulness in the software world.

Sites like Stackoverflow and other community boards offer a forum for asking questions and exchanging ideas through answers and comments.

Given that developers and teachers are willing to take time out of their schedules to help, I believe there is a responsibility on the student to ask questions that are clear and thoughtful. Also, the specifics of how the question is formatted impacts the likelihood that it will be answered.

What makes a clear, thoughtful, well-formatted question?

Before you start formulating your question, there are some steps you should take to cover your bases.

You need to understand what you are asking, i.e. what’s the software supposed to be doing that it’s not doing? What error are you getting? What is the expected result and the actual result?

It’s important to do enough basic research to understand the context of the system you are using. In other words, try to have a basic understanding of what you are talking about. If you don’t have a base-level understanding, indicate that you are a beginner.

Also, it’s important to do a quick cursory search of existing resources. If someone can find an answer to your question in ten seconds by Googling, then you can find the answer by Googling.

So, assuming you’ve thought about your question and done a quick search. What’s next?

The key to asking a good question is being able to succinctly state and summarize the problem in your question title. What’s the gist of what you are asking? You can achieve this by filtering out information that’s irrelevant while including enough context so that people can understand the ecosystem of what you’re working on.

Problem with JavaScript Objects

vs.

How do I log the 'name' property of my customer object to the console in JavaScript?

vs.

How do I iterate through object properties in JavaScript?

The first example is too general and doesn’t provide enough specifics. A contributor needs to read your full post to know if it’s something they can help with.

The second example is too specific. It’s irrelevant to the contributor that you are trying to access the “name” property from the “customer” object. They need to know that you are trying to access properties of an object in JavaScript.

The third example gives enough context to understand what is being asked while omitting extraneous details.

It’s important to include a code sample that is self-contained, so contributors can easily test and troubleshoot your code.

It’s important to include tags or keywords so that people can search and find questions that are of interest and related to their specific area of expertise.

Finally, it’s important to give your question a once-over. Proof-reading will not only make your post look more professional and easy to follow, but it will encourage you to review and think about the problem again.

For further reading on asking good questions, here are several great resources:

http://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/ http://stackoverflow.com/help/how-to-ask