Am I Asking The Right Questions?

07 Sep 2023

Many people say that there are no right or wrong answers or there are no stupid questions. But is that really true? When is comes to computer science, it is key for programmers to have a strong suit in communication in order to lead to both efficient and effective help. We all know that learning a programming language is not an easy thing to do. It takes time and practice to be the best at it. Not everyone knows the answer to everything nor is well documented.

Is there really such thing as a stupid question?

I mean I guess so… when programmers have a question they usually resort to posting a question on Stack Overflow. On Stack Overflow it is basically a Q&A site for coders who seek answers or have a question. The site is fairly notorious for its strict rules on the different questions that can be asked. The website itself even has their own article to help users learn how to ask a good question. The article has a guideline to follow that will make sure you’re asking a good question or else you will probably will be called out or criticized and block your post. The question needs to be on-topic and have a title that sums up the problem. While also making sure you did some research beforehand.


Example of a good and bad question:

Bad: JavaScript Confusion

Good: Why does str == “value” evaluate to false when str is set to “value”?


This article made by Carl Lee: “JavaScript - Function not executing properly” did not do well on giving a good title or question. The author should have done more research before posting a question because it was marked as a duplicate and showed that there was no research effort put in. One thing that went wrong, was that he inputted a long code which readers don’t want to see. This essay would be way too long if I were to copy and paste it on here. Readers want authors to post minimal, complete, and verifiable code and just not just every single line in your code. The more code there is to go through, the less likely people can find your problem.

What is a smart question?

I always resorted to Stack Overflow whenever I’m stuck on an error in my code, and there I found many examples of good questions and bad questions. In the following example, the title is clear on their confusion about the difference between the two ways of declaring functions. This is a smart question, although people might think that this is relatively an easy question to answer, it got 41 responses. They were successful in inciting discussion from multiple users. But maybe it’s only easy to answer because of how its phrased and formulated very well.

A question from Richard Garside asked the community: var functionName = function() {} vs function functionName() {}


I’ve recently started maintaining someone else’s JavaScript code. I’m fixing bugs, adding features and also trying to tidy up the code and make it more consistent.

The previous developer used two ways of declaring functions and I can’t work out if there is a reason behind it or not.

The two ways are:

var functionOne = function() {
    // Some code
};

And,

function functionTwo() {
    // Some code
}

What are the reasons for using these two different methods and what are the pros and cons of each? Is there anything that can be done with one method that can’t be done with the other?


Richard’s heading title was well understood, and it’s a summary of what he’s trying to figure out. He included all relevant tags that other users would type in on any search engine, making it easier to find. Another good thing about the question is that it’s not just a question. Instead of asking “Please help, I’ve tried everything! What is the difference between var functionName = function() {} and function functionName() {}? What are the pros and cons of each?” The asker kept it short, and easy enough for everyone to understand the confusion. The title is short but then futher explains when a user clicks the link to reveal what he has done and that he has put in some effort to answer the question. And while it may not be as important as the question itself, the asker shows courtesy, which does increase the chance of getting an answer.

Conclusion

Asking questions may not always get you the best answer, but asking them in a way that will make others want to answer them will increase the success of finding a good solution. When askers don’t put in this effort, their questions turn into “stupid question.” Based on the two forums that I have compared on Stack Overflow, “smart” questions do indeed lead to more effective and efficient answers but also helped me form a deeper understanding of what differs betwwen “smart” and “not smart” questions.