The Good and The Bad

10 Sep 2019

Picture this, you have a programming assignment due at midnight, and you are typing furiously to get it finished on time. Along the way you come across an error message in your code, and after spending hours trying to debug your code you turn to the internet to help you fix your problem. As I scour the net for help, I always notice the amount of bad questions that I have to filter out before I can find a question pertaining to my problem. Bad questions are not only a waste of time, but they also offer no help to the answerer trying to answer these questions as these questions are often times vague and confusing.

The Good

In order to receive smart answers, you must ask smart questions. This may seem easy to understand, but some people are still out there asking bad questions. As a computer science student, I often see myself using StackOverflow to help me answer any questions that I have pertaining to a certain coding language or to computer science in general. If I have a question, then that same questions has probably already been asked and answered on StackOverflow.

In the following example, we see a simple, yet effective, question that deals with JavaScript’s let and var statements.

Q: What's the difference between using “let” and “var”?
 
ECMAScript 6 introduced the let statement.
I've heard it that it's described as a "local" variable, but I'm still not quite sure how it behaves differently than the var keyword.
What are the differences? When should let be used over var?

This question interested me as I am just starting to learn about JavaScript and knowing the differences between the two keywords may help later in the future. The question itself is short and simple, but that is what makes it a smart question. Smart questions do not have to be overly complicated or have paragraphs worth of text. They have to be precise and informative. The original question what to the point, and the asker also provides additional details about his question. This question goes to show that longer that always mean better.

The Bad

In many cases, aren’t even asking a specific question. Instead they type in a problem they are having without any context, and they expect others to solve their problem. In the following example, a user’s Java code is throwing an error.

Q: java.lang.ArrayIndexOutOfBoundsException: 3

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3 at arraydekla.main(arraydekla.java:19) C:\Users\acer\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1 BUILD FAILED (total time: 0 seconds)

The asker also added a screenshot of his Java code thinking that it would make this question better. First off, the header isn’t even a question and just a java error code. The body of the question is also just an error message of the user’s code. This person obviously just copy and pasted the error they were having, and they didn’t even bother adding any other context to support their problem.

In order to make this question better, I would first state my problem in question form rather than just typing the error itself. The asker should have also added what kind of output that he/she expects when the program compiles. This allows the responder to get a better grasp of the problem and be able to respond much easier. Although adding a screenshot of the code is fine, it would be better if the code was minimal as possible but still enough code where it throws the error. You do not want to have a hundred lines of code and expect the responder to go through all the code that you wrote.

Conclusion

Everyone should learn how to write questions that are smart and effective. Unless you know everything, you will likely have questions pertaining to problems you can’t solve in the future. Knowing how to ask smart questions will likely reward you with smart answers as well. The saying “there are no stupid questions” was possibly said by a person that asked stupid questions themselves, but we know that stupid questions do exist. Asking smart questions will ultimately lead to better outcomes and answers.