The Best and Worst Ways to Use Stack Overflow

JOSHUA WEINSTEIN
Jul 29 · 7 min read
Image for post
Image for post
Photo by Bekir Dönmez on Unsplash

Stack Overflow is an incredible collection of programming and software knowledge. Thousands of students and developers use it daily to lookup answers for questions they can’t solve easily themselves. Stack Overflow taught me so much over the years, I have used it since I began to learn to program. It’s built and grown by a community of developers, with new questions and answers being added all the time.

However, contributing to Stack Overflow, asking questions and answering them, is vastly different from just searching and reading information on the site. Stack Overflow has a very steep learning curve, for a long time, it wasn’t really welcoming toward beginners. If you are interested in using it to grow and further your skills or reputation as a developer, this article is for you. On a site like Stack Overflow, there is no right or wrong, all content will eventually be moderated by the community. Yet, you will want to avoid situations where despite good intentions, you get downvoted to oblivion.

The Purpose

In fact, there’s even some users with hundreds of thousands in points that have an up to down vote ratio of over one to one thousand. That means for every one up vote they gave, they also gave over a thousand down votes. This isn’t meant to scare you, it’s to help you understand Stack Overflow does have a high standard of quality for content. Even the best answers also get their share of down votes. Any answer you give should have careful thought and effort put into it.

Being a knowledge oriented site can also imply there’s no room for subjectivity. To an extent that’s true, but it’s more complicated than that. Whether or not something is considered subjective depends on how much information exists on that particular problem, or if there is a widely accepted solution. For example, a question asking “How to add more items to a list in Python?” could only be reasonably answered by suggesting to use the append or insert methods of a Python list. An answer giving a solution by construction an entirely new list, would likely be heavily downvoted. That’s because a list in Python is designed for mutability, answers diverting from that use will simply not be useful or welcomed.

Asking “How to ensure a particular module is only imported from a certain directory?” is a question that’s more open to interpretation and does not have a widely accepted methodology. A simple answer to such a question would be to suggest inserting the directory path at the beginning of sys.path . Although that answer works, it’s still not full proof. The Python interpreter actually checks sys.modules before it checks sys.path . There’s also a completely different way to achieve the same desired behavior, to run Python in a virtual environment, avoiding conflicts between module names altogether. The point is, there’s multiple ways to answer such a question, given any answer accurately argues for itself.

Next, look at both the best, and worst ways you can use Stack Overflow to grow and improve as a developer.

Worst

Asking simple questions

Keep in mind, sometimes questions are mistakenly marked as duplicates. This can be because you weren’t clear enough on the specific answer or knowledge you sought. Good news, Stack Overflow allows you to edit a question and reopen it if this happens, netting you more points if that edit is better received.

Giving answers that don’t match the question

An example can be as follows. There is a question, “How to get the stderr from a process with Popen?”. You answer, “This can be accomplished using subprocess.run and accessing the stderr attribute of the return value”. This answer would be considered inappropriate for the question, because it’s specifying the use of a different builtin object the question is not asking about. Stack Overflow is not a discussion forum, and such answers are not useful or desirable on that particular question.

Answering questions with highly popular tags

Remember the user I mentioned that gives over a thousand downvotes per one up vote? Users similar to that are likely top contributors and lurking in popular tags. Answers you give to questions under these tags will be under high scrutiny. Additionally, many questions in such tags get answered very quickly, as many people are also looking at them. By the time you write a well thought out answer, some top contributor may have already answered it before you. Or, your answer or code may miss small details involved in answering the question, leading to a higher degree of downvotes. Generic, language syntax type of questions are frequently marked as duplicates, so you may start putting effort toward an answer for nothing.

Best

Answering questions in less popular tags

I wrote this answer to a question I had asked which to my surprise, no one answered. I explained the solution and all the needed steps for others to implement it if they found themselves in a similar situation. Yet, my answer was still downvoted, due to using a different, yet equivalent keyword argument in the setup function for a Python package. There’s no difference in behavior between the two argument fields, but was still marked down by the community. If I were to write that question again, I wouldn’t include the [python] tag.

Asking questions with no obvious solution

I have question that I asked five years ago that has since gotten over 50,000 views. The question asks how to match a particular string against many different possible strings using regular expressions. Generally, checking if a string is present in a group of strings can be accomplished with a hash set. But in the case of regex, there is no widely used method. One option, which turned out as the best answer, is using a list of words joined with the| “or” operator in regex. Another option, the second answer listed, is using named lists from a common third party library for regular expressions. Both answers work fine, but the former doesn’t depend on any other packages, it uses native Python.

The lesson here is asking questions with no direct or straight forward answers are more likely to be upvoted, and more likely to generate answers.

Conclusion

The Startup

Medium's largest active publication, followed by +730K people. Follow to join our community.

JOSHUA WEINSTEIN

Written by

Programmer, Artist, Published Author. I’m an engineer on a mission to write the fastest software in the world.

The Startup

Medium's largest active publication, followed by +730K people. Follow to join our community.

JOSHUA WEINSTEIN

Written by

Programmer, Artist, Published Author. I’m an engineer on a mission to write the fastest software in the world.

The Startup

Medium's largest active publication, followed by +730K people. Follow to join our community.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store