Asking the Smart Way

09 Sep 2021

The Trouble with Questions

I’ve always had trouble asking questions when I needed help. Most of the time, I end up figuring out the solution to my problem on my own, which does waste a lot of time. Despite hearing many professors say, “Ask questions because there’s no such thing as a stupid question,” I try to stay away from asking them. I find it difficult when asking questions because I sometimes get an answer that I can’t quite understand myself. However, I realized there must be a beneficial way to ask questions so that the answer I get will be a smart one too.

Difference Between Smart and Stupid Questions

I often use Stack Overflow to find solutions to problems I face while coding. Stack Overflow is a website where programmers ask questions when they run into issues. I will say that as I try to find solutions, I have come across bad questions that receive answers that are unhelpful or request clarification from the asker. I have never had to ask a question on there, but one day I might have to. Therefore to learn how to ask good questions, it is important to be able to distinguish the two different types of questions smart ones and stupid ones.

The following example shows what components are needed to ask a smart question. In this question, the asker wants to know how to find files that contain a specific text in Linux.

The Good Question

Q: How do I find all files containing specific text on Linux?

I'm trying to find a way to scan my entire Linux system for all files containing a specific string of text. Just to clarify, I'm looking for text within the file, not in the file name.

When I was looking up how to do this, I came across this solution twice:
  find / -type f -exec grep -H 'text-to-find-here' {} \;

However, it doesn't work. It seems to display every single file in the system.

Is this close to the proper way to do it? If not, how should I? This ability to find text strings in files would be extraordinarily useful for some programming projects I'm doing.

The title of his question showed exactly what he was trying to figure out. In addition to this, the asker began his question by stating his goal. He then went into specifics of what he tried and the result he got. This shows that he has put in the effort to find a solution to his problem, but did not have any success in finding a solution that works for him, and therefore decided to ask it himself. One thing that the asker did fail to do was show courtesy by thanking the person who may answer his question.

There were about 54 responses to his question, showing that he succeeded in receiving a solution from many users. The answers were filled with various solutions to his problem, and the top answer was very informative because it showed the command he could use along with an explanation of what each part of the command did and how it can be altered to achieve different results as he searches for a specific text.

Of course, the opposite of smart questions would be bad questions. This does not mean that his question is not worth answering, but that how it was asked may not receive helpful answers. In this example, the user wants to find a general formula to calculate the minimum and maximum height of a binary tree.

The Bad Question

Q: Binary Tree Height

I need a general formula to calculate the minimum height of the binary tree and the maximum height of the binary tree. (not the binary search tree)

The title of the user’s question was relevant to what he was trying to solve. However, when you look at the user’s problem it is evident that he did not put any effort into explaining exactly what he needed. Luckily, this question did receive responses from kind people who were willing to help. Multiple comments stated that he needed to be more specific with his question. There was also a comment with an explanation of how to get to the solution, but not giving it because it “sounds like homework” that the asker needed an answer for. The asker should have shown some effort towards finding a solution before going straight to Stack Overflow to ask for help. He could have also been more detailed with his question, but it seemed like he did not put any effort in himself to understand how to solve the problem.

Conclusion

Despite having difficulty myself asking people for help, I think the practice of asking smart questions is good and beneficial. Along with receiving smart answers, we should be thankful to the people who are willing to answer them so it is best to help them by being specific, informative, and smart when stating our questions. Smart questions will get smart answers, so I shouldn’t be afraid of asking for help when I need it as long as I ask the smart way.