Cultural Blog 9: Asking Good Questions

Thursday, January 8, 2014

As a student, your job is to learn. In order to learn, you have to ask questions, good questions. Your teachers in primary school were probably very nurturing ("Oooh there is no such thing as a dumb question. That is a good question! Gold star."), but stackoverflow (nor your senior web developer manager, your client, etc) is your sweet, nurturing middle school teacher. How do I know? One time I read a post by this kid on stackoverflow who was so nervous about asking his question that he ended the post with "im sorry, im 13 yo and am learning everything on my own" and one contributor destroyed him for not properly framing his question with enough details and purpose. Luckily, another contributor was like "Whoa, chill he's only 13."

crazy tyra

stackoverflow allows you to ask your question and other people contribute by giving a detailed explanation, correcting your code, suggesting better code, linking supplemental resources, or like, dishing out really harsh criticism on why you suck and shouldn't bother becoming a programmer since you can't even ask a question properly.

So, since you can't always add sorry-im-13-yo after asking your question to your fellow peers, colleagues, managers, stackoverflow, etc, today's post is about asking good questions.

Attempt it once, twice, thrice, qua...?

According to Google, nothing comes after thrice. To learn effectively, you have to try. Try solving the problem yourself by approaching it in different ways, giving yourself a break, taking a step back and then coming in with a fresh prespective, googling the same question in a different way with different keywords, etc. Sometimes when you struggle for a bit and then finally find the solution, you end up learning several other things along the way and most of the time, the solution sticks with you longer because of how much time and effort you put in.

That being said, if you are running low on time or you're just absolutely lost, sometimes it is more effective to ask for help.

Descriptive Title

If you're asking a question in a forum, in-person, or via email, it's good to start out with something that summarizes the specific problem in one sentence or two so the person will have a running start on understanding what you need and how they can help before you go further into details. Avoid being vague by including relevant keywords.

Bad: Question about looping in Javascript
Better: Which is better: for loop or while loop in Javascript?
Best: Is the for loop the fastest way to print each element in an array in Javascript?

Introduce the problem with additional details

Now that the person has an idea of what the problem is, it is good to provide additional details so they can understand what you have done, how you encountered and approached the problem, background research you've tried, and other things that are preventing you from achieving what you want.

Bad: I can't get it to work, I don't know why. I copied the code exactly.
Better: I used both the for and while loops and both ran, but I dunno, which one should I use?
Best: If I have a large array that has over 100 elements inside, would it be faster to use the for loop to print each one out? When should we use the for loop over the while loop?

Copy and paste the code that you've written

Without an example of what you're working with, it is hard for others to know what went wrong. It is good to post the code that you've written, as well as any other code that is related or affected by it. Another reason why it's good to post your code is there are a lot of different ways to do the same thing, so by showing others what you have, they can give you suggestions on better code, see if there is anything wrong with your syntax or if the code is outdated for certain browsers, suggest different approaches, etc.

Proofread, use correct spelling and grammar

This should be the easiest part on your end from looking like a fool. Nowadays, things have built-in spellcheckers, but still-- spelling in doubt? Dictionary.com or just look it up in Google, which will ask you "Did you mean [correct spelling]?" in the search results if it's misspelled.

Look over what you've written and check: Did you include enough details and get rid of anything that is not useful information? Does this make sense? There's nothing more frustrating then trying to help someone but they aren't making any sense and are wasting more of your time by re-explaining or not giving enough information in a logical manner.

Now go ask good questions!