How To Ask a Question That Gets Answered on Stack Overflow

Posting a question on the most-visited website by developers

Nabil Nalakath
Nov 12, 2019 · 4 min read
BG Photo by Iva on Unsplash

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

  1. Be specific in the title (Don’t post the entire issue or a broad question in the title).
  2. Use the right tags. (This is very important to get quick answers.)
  3. 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.)
  4. Try to post screenshots if you are explaining issues that are coming up during runtime.
  5. Post proper error logs, if any. (Especially in cases where apps are crashing.)
  6. 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.
  7. 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.
  8. 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:

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.

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.

Better Programming

Advice for programmers.

Nabil Nalakath

Written by

Sapiophile. I Speak Code, love literature, binge thrillers, enjoy bibliosmia, crave desserts and seek adventures.

Better Programming

Advice for programmers.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade