Introduction
Along your programming journey, you will inevitably need to ask questions in an online coding community like ours or in conversations with your colleagues. While asking questions may seem rather simple, in a programming environment it is essential to ask well-formed questions with as much context as needed so you can get the most out of asking for help. In essence, “help others help you!” This lesson will provide you with the tools to effectively ask questions in communities such as our Discord chat, Stack Overflow, and in the workplace!
Lesson overview
This section contains a general overview of topics that you will learn in this lesson.
- Explain techniques for asking programming questions.
- Explain and avoid qualities of “bad” questions.
- Ask effective and well-formed questions.
Tips for getting the best help possible
Always provide your code and the surrounding context
When asking a question, it is essential to provide your code, error message, terminal command, server output, and other relevant details. You should provide as much context as possible and zero in on the specific problem, such as pointing people to a specific function or line number in your code. Providing this relevant information makes it easier for others to help you.
If your question does not provide any code or other relevant information, it will be difficult for others to help you. In order to fully understand your question, there will be a lot of unnecessary back and forth conversation. This can be discouraging for you because any answers with incomplete information will not solve your problem. This process can be frustrating for those helping because the meaning of your original question changes as you add more context to it. If you truly want to ask a conceptual question, you should indicate this as part of your question.
Ask about the problem at hand, not the solution itself
A lot of learners ask exactly how to approach a given task or assignment in this curriculum, such as the following:
- “How do I complete Step 5 of the Rock Paper Scissors Assignment”?
Keep in mind that you’re supposed to figure out how to solve the assignments yourself, and figuring out an approach is essential to your learning journey. A much better question might look like this:
- “Hey, I’m trying to return a string that displays the winner in Rock Paper Scissors, but I’m getting a syntax error on line 12. How can I fix this? Here’s my code.”
In sharing your attempt, people know what you’ve tried and won’t suggest things that might not have worked out for you. It also allows them to debug your current iteration of code, rather than sending you down a path that has you start all over again when you might be very close to a solution.
Now, if you’re completely stuck with where to start, it’s completely fine to let people know that you’re stuck. Asking where you can start and what you can research to get on the right track empowers you to be able to resolve issues largely on your own in the future, and might even empower you to help others with the same issue later on. It is also recommended that you share your pseudo code so people can nudge you in the right direction or correct any misunderstandings you may have.
Don’t take asking for more context to heart
People who volunteer in coding communities are here to help! A question you may feel is coherent and “obvious” probably isn’t if you are being asked for more context. While something may seem “obvious” to a beginner, it’s sometimes nowhere near “obvious” to an expert. An expert knows about many, many more situations that could cause an issue someone is experiencing, and would want to refrain from sending a learner down the wrong path. People take time out of their day to help, so make it as easy as possible for them to help you! There’s probably a good reason why they need more information, so trust their judgment and experience when they ask. Many people who help in coding chats are unpaid volunteers, and are in no way obligated to answer your query. But because they truly want to help you, they will ask for more information when needed!
Assignment
- Don’t ask to ask, just ask demonstrates the importance of just asking your question and not asking to ask your question.
- Read about the “XY Problem”, which is a common pitfall both new and experienced programmers fall into when asking questions.
- Read and bookmark our community guide How to Ask Technical Questions. It is a great reference to refer to whenever you find yourself needing to ask for help, and you might find yourself solving your own problem as you think about the points listed in the article.
Knowledge check
The following questions are an opportunity to reflect on key topics in this lesson. If you can’t answer a question, click on it to review the material, but keep in mind you are not expected to memorize or master this knowledge.
Additional resources
This section contains helpful links to related content. It isn’t required, so consider it supplemental.
- It looks like this lesson doesn’t have any additional resources yet. Help us expand this section by contributing to our curriculum.