How To Ask a Question That Gets Answered on Stack Overflow
Posting a question on the most-visited website by developers
When someone tells me about an issue they are facing in development, in most cases, my immediate response would be: “What did you find on Stack Overflow?”
And, there are people who give weird answers like: “I don’t know how to use it, I have been banned for asking poor questions, people always downvote my posts or give me links on how to ask questions,” etc.
Stack Overflow is one of the most helpful and most visited websites on the internet, but it is also one of the most brutal platforms on the internet.
People will show no mercy if you make a mistake or ask a stupid question, and that’s how the platform has maintained its standards ever since its inception. So, don’t expect anything less.
Instead, get used to it and change the way you ask questions. Enough said, let’s see what some of the important things are that you have to take care of while asking a question.
Things to Be Noted While Posting Questions
- Be specific in the title (Don’t post the entire issue or a broad question in the title).
- Use the right tags. (This is very important to get quick answers.)
- Post relevant parts of the code and format them as code using code tags in the question editor. ( If code is not neat, most people won’t bother to answer.)
- Try to post screenshots if you are explaining issues that are coming up during runtime.
- Post proper error logs, if any. (Especially in cases where apps are crashing.)
- If you have a partial output without errors and want specific modifications to the output, and you can’t seem to figure out how to, mention it clearly in the question by dividing it into two sections:
• What you have now.
• What you need to achieve.
- If it’s UI-related, post wireframe screenshots and if that’s not available, try to mark what you need or the change you are trying to make using simple tools like Paint in the existing UI screenshot.
- Post version codes if you think that the version code might be relevant in answering the issue. (E.g.: If the issue happens only in an old version of PHP or Android and not in newer versions.)
Mistakes to Avoid While Posting
- Never post parts of the code that contain a brand name or company name.
- Crop screenshots to show only relevant content.
- If the code contains parts, like keys or passwords for, for example, email passwords in PHP mailer code, always replace the password field with **** or special characters.
- Don’t post special algorithms or app engine codes that you have created yourself unless you don’t mind other people using it or making it open source.
Bad Questions and Good Questions
Let’s consider this post with 146 downvotes:
How to send 100,000 emails weekly?
Short answer: While it's technically possible to send 100k e-mails each week yourself, the simplest, easiest and…
As you can see in this example, the question that has been posted is not a specific issue. If you are asking for a tutorial type answer like this, then Stack Overflow is not the place.
Taking the example, in this case, the user is asking about sending an email to 100,000 users on a weekly basis in PHP. But the question does not show any effort from the user’s side.
There is nothing mentioned about what the user has tried so far or any particular error they are facing. This is a perfect example of how not to ask a question.
Also, here are some good example questions for you to refer to.
Why is processing a sorted array faster than processing an unsorted array?
Consider a railroad junction: Image by Mecanismo, via Wikimedia Commons. Used under the CC-By-SA 3.0 license. Now for…
How to enable Horizontal Scrolling For chart.js in Ionic
I am using Chart.js version 2.7.2 in my ionic app for displaying a bar graph. However, I am not able to get the chart…
App is crashing on some devices. Android studio shows out of memory exception error
Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Provide details and share…
As you can see, even if someone doesn’t answer, you will still get upvotes if you ask a question in the proper way.
Finally, if you get an answer for your query and it's working for your requirements, mark it as an accepted answer to close the question.
This will help the person who posted the answer to gain reputation and encourage them to help more people.
After all, the platform exists only because of these selfless people who are ready to help, so this is the least you can do for them.