How to Ask Great Questions Online

The majority of software development includes asking a lot of questions. Administrating the Ruby On Rails Link Slack, I’ve seen some of the best and worst questions asked.

Good questions save time and effort for both the asker and answerer, follow these tips to become a superstar question asker and super power your development cycle with and without community assistance.

Understand exactly where in your code it’s failing, and if possible why the error is occurring Start with the exception, is it familiar? Where have you seen this exception before?

If the exception is unfamiliar, Google exactly the exception with the message and see if there’s anything familiar online regarding your particular exception

Google a few other relevant topics and see if other people have had a similar issue

Work through the code line by line and figure out the first line that something goes wrong.

Remember that your exception line might not be the root issue. Something like NoMethodError: undefined method 'downcase' for nil:NilClass means you’re calling #downcase on a variable that equals nil . Rather than solving this on the line having the issue, is there a way you can ensure the offending line never has a nil variable? Clearly and concisely describe the problem you’re having What did you do to provoke this issue?

What can you do to consistently reproduce the issue at hand?

What do you expect?

What is actually happening instead?

What have you already tried to do to resolve this issue?

Were any of the potential solutions fruitful?

What do you think the problem is?

Include exception messages, stack traces, or anything that could be useful in resolving the issue

Be as clear as concise as possible to save the community effort; the community works together to help answer questions and the more effort you put in the more we’ll be able to help

It’s not fun (for community members, anyway) to play 20 questions Provide the smallest amount of code you can that still can reproduce the issue The less the community reads, the faster we can help

If you give the community broken or partial code, we might not have enough context to help you

If it’s complex functionality maybe write the smallest test possible for happy path so the community can help you use Test Driven Development to get to a solution with a shorter feedback loop

Ensure this is the smallest amount of code to reproduce the issue at hand; community members don’t want to sift through 500 lines of code to find the 1 line of code that isn’t functioning as expected

If you do need a lot of code to express a point, use a Github Gist or something similar to put together your code into 1 manageable location so you don’t create unnecessary scroll-back Take your time to type with formatting, proper grammar, punctuation, and as few typos as possible. Format your code snippets, for Slack you can use single ` around your code for inline formatting and triple ``` for multiline formatted monospace text

Proofread your question multiple times

Reading your question might give you a resolution Stay online for an answer Stay online for a reasonable amount of time. If you have to leave before you get a reply, put a message that you need to head out but if they wouldn’t mind @mention’ing you you’d really appreciate it

If you resolve your issue, let the community know so they don’t waste time helping you further Thank everyone that helped you emoji reactions on particularly helpful messages

A nice thank you message to the people that helped you get to a resolution

Even if this is the first question you’ve asked, it won’t be your last. Be respectful and you’ll continue to get the help you need!

Before long you’ll be the one answering questions on online communities. Good luck and happy hacking!