Stack Overflow 101
With millions of registered users, Stack Overflow is far and away the most popular developer Q&A forum in the world. It’s THE go-to destination for developers who need help, where fellow devs and subject matter experts voluntarily answer questions and share expertise. Never used Stack Overflow before, or haven’t had much luck getting your questions answered there in the past? This post is for you!
Before you can participate on stackoverflow.com, you’ll need to create a user account. Use the Sign up page to choose your display name, specify your email address, and set your password. Click the button in the registration confirmation email that you receive, then optionally set a profile picture and choose the technology tags that interest you.
Tip: Your display name will influence how folks perceive you on Stack Overflow. During the Sign Up process, explicitly specify your display name — don’t just accept the default display name format of
user1726473. Formats like
FirstName LastName or
FirstName LastInitial inspire more respect than names like
worldsBestDev2022. Regret the display name you chose during Sign Up? No worries — you can change display name by editing your profile at any time.
Welcome to Stack Overflow!
You’re now one step closer to getting help! But first, do yourself a favor by learning a bit about the site:
- Check out the product tour for a quick summary of how the site works: https://stackoverflow.com/tour.
- Review the code of conduct for rules of engagement that strive to maintain a respectful, productive, and collaborative forum.
Finding an answer
Let’s assume you’re building an API integration using Python and the Microsoft Graph API, when you run into a problem with an API request. You’ve seemingly followed the approach described by the docs, but no dice — the server is returning a
BadRequest error in response to your
SendMail request. Unable to figure this out on your own, you head to Stack Overflow to ask for help. But wait — not so fast!
Before you post a question to Stack Overflow, take the time to search the repository of previously asked questions. If the info you need already exists, you’ll save yourself the trouble of posting a new question AND avoid reprimand for posting a question that’s already been asked and answered. See this page for details about search syntax: https://stackoverflow.com/search.
In this scenario, you’d search for posts containing:
- the tag
- the tag
- the words
And BINGO — you’re in luck! Not only does the very first question in the results seem to be describing your exact problem — it has an accepted answer (as indicated by the text “
[checkmark] 2 answers” with a green background)!
View the question and answer(s) by clicking the title in the search results.
- If the answer provides the info you’re needing, give it an upvote (click the up-arrow next to the answer) to indicate that the answer is useful. (You’ll need a reputation score >= 15 before you gain the upvote privilege.)
- If the answer doesn’t provide the info you’re needing, continue searching until you either find the info you’re needing or you’re confident that your question hasn’t been previously asked and answered.
Asking a question
Can’t find the info you need in the existing repository of questions and answers? If you can write a good question on Stack Overflow, you’ll likely receive a good answer in return. But what makes a good question?
Imagine a scenario where you’ve run into an API issue and are seeking help from a more senior dev on your team. Approach them empty handed, expecting them to troubleshoot your problem and write all of your code for you, and you’ll likely be turned away (not to mention ruin your reputation with them). You’re much more likely to get the help you need if you can clearly and concisely explain your problem, what approach(es) you’ve tried to solve it, where your code seems to be failing, and exactly what error message or outcome you’re seeing.
This same mindset applies when asking questions on Stack Overflow! The folks with the knowledge to answer your questions are busy with their own projects. They may enjoy sharing their expertise and helping others, but you shouldn’t expect them to write all of your code for you.
How to ask a good question
When posting a new question to Stack Overflow, follow these best practices:
- Title should summarize the specific problem you’re having. Make it complete but concise, providing enough information that folks with the right expertise are likely to open it and read the rest.
- Body should provide the following information:
- What are you trying to achieve? (e.g., I want to send an email using the Microsoft Graph API.)
- What’s the context (language, technology, API, SDK, OS, etc.)? (e.g., I’m using the Python 3.7 with the Microsoft Graph API v1.0.)
- Are there any constraints? (e.g., In case it matters, I’m not able to use the latest version of Python — I must use v3.7.)
- Specifically what approach(es) have you tried? (e.g., Here’s my code, which I based upon info in the [Working with Users section of the docs]:
- Include links to any documentation that you’ve relied upon in developing your approach.
- Include just enough code to let others reproduce your problem.
- Always specify code as text (formatted as
code) — never include just images (screenshots) of your code, as others cannot copy/paste code from an image to reproduce your problem.
- If your code contains any sensitive data (e.g., personally identifiable information), replace it with generic data before posting your question. NEVER include API access tokens or passwords in the code you post!
- For each approach that you’ve tried, what was the outcome? (e.g., Running this code results in a
BadRequesterror response, as shown here:
- What’s your ask? (e.g., Why is my code resulting in a
- Tags should indicate which language, SDK (library), API, technology, etc. are relevant to your question. Fail to tag your question appropriately, and you likely won’t reach folks who have the expertise to help.
The following screenshot shows a well-written Stack Overflow question that complies with these best practices.
What makes for a bad question?
When asking a question on Stack Overflow:
- DO NOT omit information that describes how you’ve already attempted to solve the problem. Ask a question like “How do I create a user with the Microsoft Graph API?” without including any code that shows your attempt to do so? Not only are you likely to be scolded for lack of initiative, your odds of getting a helpful answer are slim to none.
- DO NOT submit feature requests or ask about in-product functionality that’s accessed via the graphical user interface (GUI). Stack Overflow is a place to get help with your coding problems — if there’s no code to include as part of your question, it likely isn’t appropriate for Stack Overflow.
- DO NOT ask questions without first researching on your own. Expect to be get your hand (virtually) slapped if you ask questions that are easily answered with Google search or via a previously asked & answered question in Stack Overflow.
- DO NOT ask multiple questions in a single post. Having trouble with creating and updating users with the Microsoft Graph API? Post two separate questions — one about creating, one about updating.
To learn more about asking questions, see the Stack Overflow guidance here: https://stackoverflow.com/help/how-to-ask.
Responding to feedback
Asking a question is only the start of the process. As others respond to your post with comments and/or answers, follow these best practices:
- Be receptive to feedback if someone comments on your post to request additional information or clarification. By providing information that’s requested, you’re more likely to get the help that you’re seeking.
- When someone comments to request additional information, update your original post to include that information — don’t just add it in the comment thread. You can indicate in the comments that you’ve done so (e.g., “I’ve updated my original question to include that information.“) This makes others more likely to benefit from the Q&A in the future, as they won’t have to read through the entire comment thread trying piece things together themselves.
- Avoid asking entirely new questions in the comments. Oftentimes an answer (even if it sufficiently addresses the original question) leads to another question. When that happens, create a new post for the new question (instead of posting the new question in the answer’s comment thread). This makes others more likely to benefit from the Q&A in the future, as questions are easily searchable, whereas comments are not.
- Finally, BE GRACIOUS. People are voluntarily making the effort to help you! If someone provides a helpful answer to your question, mark the answer as accepted and give it an upvote (if you’re able to do so). Not only are you rewarding the answerer with reputation points for the accepted/upvoted answer, you’re also making others more likely to benefit from the answer in the future (since folks are more likely to click-into a question if its answer is accepted/upvoted). Adding a thank you comment is also a nice touch!
So there you have it…
…the ins and outs of using Stack Overflow to get help when you’re stuck. If you don’t already have a Stack Overflow account, what are you waiting for?! Head there now and sign up: https://stackoverflow.com.
Note: Since API Newbies are most likely askers on Stack Overflow (not answerers), we haven’t covered best practices for answering questions. Want to answer questions on Stack Overflow? Check out How do I write a good answer? within Stack Overflow’s help center.