[

GET WITH THE
PROGRAM

]

TOUGHENING UP ON CODING AND LIFE

How to Ask Effective Questions

When asking a question, it is important to make sure that it is easy for another person to understand. By putting yourself in the shoes of someone who doesn’t know what your question is, you can communicate your question more clearly. Here is a suggestion for the general format of how to ask a thorough question:

1. Begin with a title or overarching question.

Within the question, be specific about the result you want to achieve. What is the goal of your question? Is it to get a certain output from your specific code? Is it to see examples of the implementation of a certain method or syntax? Or it is to understand the purpose of certain syntax? Basically, you can first identify what type of question it is (such as "why", "what", and "how".)

Let’s say I’m confused about implementing the mouse hover feature in jQuery. I could come up with a more specific overarching question, depending on what I want to know. Here are some examples:

"How do you code an image that changes upon a mouse hover in HTML/CSS/jQuery?"

"Why does my hover() event listener code in jQuery fail?"

"What is the purpose of the input arguments for the jQuery method .hover(handlerIn, handlerOut)?"

2. Elaborate with the specifics of your code, or any other necessary context.

"I am trying to change my black logo image to a different red logo image when a mouse hovers over. it. Here is my current code:"

3. Clearly state what the problem is with your current code, understanding, or state.

"When I run my mouse over the original logo, it changes to the new image, as it should. The problem is that it does not revert back to the original image when I move my cursor away from the changed image."

"As I understand it, .hover method should change an image to a different image when the cursor points to it. What I don’t understand is what specifically the handlerIn and handlerOut arguments represent."

4. Recap or rephrase the overall question to make it clear what information you are seeking.

"Given this code, what should I change in order to make it run such that it implements this feature?"

"What would be an example that would demonstrate the purpose of the .hover method definition is?"

5. As a final note, be clear about what is a question and what is merely an expression of curiosity.

This is not so much an issue on StackOverflow/in written form, but it can come up when working in person . For example, two days ago, I was at Pier 39 looking at some sea lions with one of my current Dev Bootcamp roommates. I found myself asking him a lot of questions about the sea lion. ("Why do sea lions all lie on top of each other? Is it a social thing? Are they at all related to walruses? Do they make those arf arf sounds to communicate something, or is it just sort of their default setting?")

I don't know why I had so many questions about sea lions. I also don't know why I was treating my roommate like he was some sort of sea lion expert. We realized that I wasn't necessarily asking for immediate answers, but simply expressing my curiosity out loud. A better way to phrase my thoughts would have been, "I wonder why sea lions…"

Being conscientious about the phrasing makes it clear what is an actual question, and what is simply food for thought.