A guide to asking questions on stackoverflow
If you are not aware of stackoverflow then here’s a short description: a collaborative place for programmers answering questions that other programmers encounter. This post is kind of a checklist when posting questions on stackoverflow.
Recently there has been an influx of blogs that have stated the decline in the quality of stackoverflow questions and/or audience. Being someone who has learnt so much from stackoverflow myself, I hope to restore some of the loss in quality of the questions asked.
Write a good description
Before you hit that submit question button, walk yourself through the description of the questions yourself. Does it make sense to help yourself if you were to read it? It’s important that the question have ample description of the steps that you have followed. Reading the documentation is a good practice. State if you have read the docs. It’s also useful to mention any similar questions you may have encountered while solving this issue.
Add some code
Since stackoverflow is mostly about programmers helping out programmers, it’s best to share code that you have written so far. It could also be something you picked up from a blog post or documentation. The idea is for you to be a better programmer by writing code. Once you paste your code make sure it’s readable, commented where necessary and indented appropriately. Remember, you want people to help you. The more effort they need to put in, the longer it will take to receive an answer.
Error logs
While syntax errors are easy to fix, there are times where exceptions are raised which could be related to the version of the package or libraries that you might be using. A stack trace accompanied with your question could help someone understand where your program fails.
State versions for everything used
While asking a question that may pertain to a specific libraries, extensions, plugins or even programming languages, it’s best to state the versions of the packages that apply. It makes it easier for someone to check the source code for the library and help you find your answer more quickly.
Directory structure
If your question contains more than one file, be sure to include the project/directory structure. You can paste an image or write the file structure in a unordered list format(<ul>
). You can also include gists of the files that you are referring to in your questions.
Found an answer yourself? Post it
You asked a question and nobody answered but you figured it out anyways. In the future when someone else comes across the same issue on stackoverflow they would love to know the answer(to the question you posted). Don’t leave them hanging, just post the answer you came up with. It will not go unnoticed.
Other minutia
Don’t forget stackoverflow is supposed to be a collaborative environment. Be nice. This is supposed to be a learning experience for you and the person who answers. Guide them through your thought process. They are sitting far far away in front of a computer screen. Text is not considered the best form of expressing emotions. Try to keep it civil and if you ever have the opportunity to help a fellow developer, take it on!
I am writing a book!
While I do appreciate you reading my blog posts, I would like to draw your attention to another project of mine. I have slowly begun to write a book on how to build web scrapers with python. I go over topics on how to start with scrapy and end with building large scale automated scraping systems.
If you are looking to build web scrapers at scale or just receiving more anecdotes on python then please signup to the email list below.