DEV Community

Cover image for Guide To Asking Questions About Code
Ayu Adiati for Virtual Coffee

Posted on • Updated on • Originally published at adiati.com

Guide To Asking Questions About Code

Hi Friends πŸ‘‹

In my early stage of learning, I had no one to ask questions.
I had to Google and rely on Stack Overflow to find answers.
As a newbie, I didn't know how to start asking questions and how I should ask my questions.
At that time, looking at how mean people react to newbies or accidentally repeated questions on Stack Overflow was one of my reasons not to ask questions.
I was sure my questions would be foolish because they would be a super beginner. And what if someone asked these questions before but in a different format that I'm unaware of?
My survival thought was, "I better get frustrated than bullied." πŸ˜…

But then I find out that there are no stupid questions regardless you're a newbie or not.
So, if you need help, ask for help.

Background

Our members at Virtual Coffee gathered ideas on how to ask questions.
And I recently helped put them into a Guide To Asking Questions About Your Code and got it up on our website.

It's very critical for developers to know how to ask good questions.
So, without further ado, here is a guide to asking coding questions.

How To Ask Questions

Before Asking The Question

  • Go through your code line by line.

    You want to know what your code is doing so you can answer questions. Take some notes if necessary.

  • Do some research before asking questions.

    You want to avoid asking questions you can figure out by Googling your problem. You can also improve your skill in finding solutions by Googling yourself.

  • Check for some typos.

    Sometimes an error arises from a single typo.

  • Google the error that you encounter by copy-pasting the error message.

    Most of the time, you can find some answers from people who experienced the same error as yours.

When Asking Questions

Getting started

  • A simple "Can someone help me with {something}?" is enough to start a conversation.
  • Be specific about what you're looking for.

    "Does anyone know why my MongoDB authentication failed?" is better than "My app is crashing."

  • For a more general question or when trying to grasp a concept.

    "Does anyone have experience with {something}?" or "Can someone explain {something} to me like I'm five?" is a good starting point.

Asking questions

  • Specified details as much as possible, such as:
    • What language, framework, or library version are you using when encountering the error?
    • What operating system (e.g., Windows, Mac, Linux) and version are you experiencing the problem on?
  • Provide relevant code along with your question, if possible.
  • Explain the command or steps that you run to reproduce the problem.
  • Describe what you have tried to fix the problem.

    It's okay if you don't know where to start, but share whatever you have already tried/ruled out.

  • Read through your question.

    You want to ensure that your question makes sense and you've included all information needed for others to help you.

Final Words

Last but not least, remember to thank people and be kind. They spend their valuable time reading and helping you answer your questions.


Thank You Notes

Special thanks to David Alpert, Jonathan Yeong, Dan Ott, Abbey Perini, Mark Noonan, Travis Martin, and Claire Martinez for throwing ideas and making this guide possible! πŸ’™

Additional Resources


Thank you for reading!
Last, you can find me on Twitter. Let's connect! 😊

Top comments (4)

Collapse
 
aishwaryak99 profile image
AISHWARYA K

hey thanks for sharing its really helpful as i am a new developer everyday, I encounter one or the other issue while i code i usually use to search on google but later realized that not all the problems solution are or would be there is stack overflow or google.

really its a google article loved it thanks.

Collapse
 
adiatiayu profile image
Ayu Adiati

Thank you for reading!
And very happy to hear that it helps! πŸ˜ƒ

Collapse
 
harithzainudin profile image
Muhammad Harith Zainudin

indeed, mostly people are afraid to ask. Thanks for sharing this!

Collapse
 
adiatiayu profile image
Ayu Adiati

Thank you for reading! 😊