How to look smart on Stack Overflow

05 Sep 2023

I have always been told by previous professors that there is no such thing as a “stupid” question, however, Eric Raymond thinks otherwise in his article, “How to ask questions the smart way.” Stack Overflow has become one of the most popular websites for programmers to ask and answer coding errors that need to be fixed. Although this website can be used to learn how to code and get your program working, Stack Overflow shouldn’t be the first option that you should go to. Raymond suggests that before asking your coding question on Stack Overflow, try researching your problem on the internet, source code, or other forms of trustworthy resources. This ensures that you are receiving the best help that you need in order to become a better programmer in the future.

You’ve been staring at your code for 2 hours now and you still haven’t found the solution to your error! You’ve tried searching on the web or asking a friend who’s skilled in programming, and you still haven’t figured it out! After multiple attempts of trying to fix your error, Stack Overflow is a great option to ask for additional help. In Raymond’s article, he suggests that there are certain guidelines that need to be followed in order to receive the best explanations about your code and why the solution should work. Raymond labels these types of questions as “Smart questions.”

What is a smart question?

If you are still unsure on what a smart question should be like, the post “Django api returns Gif as JPG despite a function to add it as video” is a great example. One of the guidelines of a smart question was having meaningful and specific subject headers. The post’s header summarizes the issue of the code in one sentence, while also being concise and clear to other users. By being as descriptive as possible, you are able to gain the attention of users who are familiar with this issue and can reply with a possible solution.

Beyond the subject header of the post, Raymond states that programmers should also describe the problem’s symptoms, and not make any assumptions of what the problem can be. The description of your problem should also be in chronological order. In the post, the programmer states “From my limited understanding, it is taking only the first frame of the .gif and uploading it as an image.” With this helpful information, other users are able to gain a better understanding of what the error can be caused by. The post also describes the results that they received from their previous attempts of trying to fix their problem. The post states “I have already ran troubleshoots through Postman and came to the conclusion that my flutter app sends it as a .gif and it gets returned as a .jpg.” With this information, other users can now suggest new solutions in order to resolve the error as soon as possible.

By following Raymond’s guidelines, the post received a descriptive reply on what the main problem was in the code. The post was also able to receive a solution to the problem, while getting a descriptive explanation on how this solution works.

What you shouldn’t ask on Stack Overflow

Now that we have a better look into what a smart question is, programmers should also know what not to do when trying to receive help from other users on Stack Overflow. The post “Java compiling error, please help, i suck at java” is a good example of what not to do on Stack Overflow. This post shows multiple characteristics of an unsmart question. One of the most notable mistakes on this post is the subject header. The header does not give a clear description of what the problem is in the program. Saying “Java compiling error” is not concise enough for other users to understand what the error of the program is. The post also uses “please help” and “i suck at java” to show that they need help from someone as soon as possible. In Raymond’s article, he explicitly states to not ask for help this way and that you should use correct punctuations in your posts. Saying “i suck at java” is not a professional way to ask for help from other developers and programmers.

Not only is the header of the post not concise, but the whole entire post itself is not clear enough for other users to fully assess the issue. The original post copied and pasted the RuntimeException statements that they received from their program and stated “I know it tells me what the problem is, but how do I fix it?” Just by reading the post, other users can tell that the programmer did not do enough research on their error before going to Stack Overflow. It is obvious that the RuntimeException will tell you where the error is in your code, but what part of the error are you confused on? Is the readFile() function returning something unexpected? What is this program trying to do? The post leaves so many unanswered questions. Better yet, the post did not have all of the code that is needed for the program to work! The user just puts “oh and I do have more code if needed.”

As a result, this unsmart question received a vague answer from another user on Stack Overflow. The answer just simply states what line of code the programmer should include in their program without any descriptive explanation to why this solution should work.

Learning how to program from previous mistakes

Programming can be a challenging journey for many people who are trying to get into this career path. One of the biggest challenges in programming is trying to fix your errors in your code, while also learning from your mistakes. Asking unsmart questions on Stack Overflow can leave you with many unanswered questions as to why your program doesn’t work. In my introductory Computer Science classes, I produced many errors while trying to program an assignment. However, taking the long hours to try to understand your mistakes has benefited me more than just simply receiving the answer. Although these mistakes can take hours to fix and understand, those long hours will overall help you become a better programmer.