How to ask a question in computer science...
Here are some tips on asking questions in computer science. Specifically, these are tips for asking me (the professor) for help. Many of these tips can be used in industry as well.
Let's start out by looking at some examples of some poorly asked questions.
- "My program crashes when I type in negative numbers."
- Reason this is bad: No question was asked.
- You need to ASK A QUESTION instead of fishing for information and hints.
- "It is printing backwards. What is wrong with my program?"
- Reasons this is bad:
- The question is way too vague of a question with no background information given.
- The question is way too abstracted with no detail. It is like calling a mechanic on the phone and asking why your car does not start when you turn the key. There can be many reasons (battery, starter, fuses, relays, timing belt, fuel pump, fuel filter, no gas, no engine in the car, etc.). Now the mechanic has to walk through a bunch of possibilities and does detective work and will probably ask you a bunch more questions to start the investigation: ( Does it have gas, Does the motor make a noise, Is there any fluid under the car?)
- Computer science is about solving problems and critical thinking. These are are essential skills in the industry. You need to dig deep into your code and figure out what is happening. You need to learn to ask the right questions to yourself. You need to isolate the problem and figure out specifically where the problem resides.
- A mechanic has to repair a car that someone else designed and built. Often in computer science, YOU are the author of the code and you are the one that ultimately needs to solve the problems.
How to ask a good question:
- Present the background to the problem.
- Present what you have tried and how you debugged it.
- Present specific issues.
- This means that you need to dig in deep into your code and trace it.
- Use debuggers and step through your code line by line while it runs.
- Debugging should not be comprised of only examining program output.
- You need to talk about variables, functions, data, states, etc. The output is only the symptom of the real issue.
- Perhaps show a small snippet of code (not the entire program)
- Explain what you expect to happen
- Explain what actually is happening.
- Show your thought process in how you debugged it so far.
- Finally, ask a question
- Your question should be presented in a clear way where the reader does not have to read your mind.
- You should be asking questions about specific technical aspects.
Realize that in industry, your colleagues will be busy and you cannot over burden them with detective work that you should have done.
Stackoverflow also gives guidelines for asking good questions.