How to Ask Good Questions
Get better answers from Stack Overflow, Discord, AI, and developers. The format that gets help fast instead of being ignored.
Why this matters
Bad question: Ignored, downvoted, closed, or answered with “what did you try?”
Good question: Answered quickly, sometimes with multiple helpful solutions.
The difference is not about being smart. It’s about giving helpers the information they need.
The format that works
1. What are you trying to do?
One sentence of context:
- “I’m building a login form and need to send credentials to my API”
- “I want to fetch data when the component mounts”
- “I’m trying to deploy to Vercel but the build fails”
2. What did you try?
Show the code. Not your entire project—the relevant part:
// What I tried:
const response = await fetch('/api/login', {
method: 'POST',
body: JSON.stringify({ email, password })
});3. What happened?
The actual result:
- The exact error message (copy-paste, don’t paraphrase)
- The behavior you observed
- Screenshot if it’s visual
Error:
POST http://localhost:3000/api/login 401 (Unauthorized)4. What did you expect?
What should have happened:
- “Expected: 200 OK with user data”
- “Expected: Page navigates to dashboard”
- “Expected: Form shows validation error”
5. What you’ve already tried
Shows you’ve made effort:
- “I checked the API endpoint exists—it works in Postman”
- “I tried adding Content-Type header”
- “Searched for the error but solutions were for different frameworks”
Example: Bad vs Good
Bad question ❌
“Help! Login not working!!!”
What’s not working? What error? What code? What did you try? Nobody can help with this.
Better question ✓
“Login API returns 401”
I’m getting 401 Unauthorized when submitting my login form.
javascriptconst response = await fetch('/api/login', { method: 'POST', body: JSON.stringify({ email, password }) }); console.log(response.status); // 401The API works in Postman with the same credentials. What am I missing?
Good question ✓✓
“fetch() returns 401 but Postman works—missing headers?”
What I’m doing: Sending login credentials to my Express API
The code:
javascriptconst response = await fetch('http://localhost:5000/api/login', { method: 'POST', body: JSON.stringify({ email: 'test@test.com', password: 'test123' }) });The error: 401 Unauthorized (no response body)
What I expected: 200 with JWT token (works in Postman)
What I tried:
- Confirmed API is running
- Same request in Postman returns 200
- Checked CORS is enabled
Environment: React 18, Express 4, running on localhost
This gets answered in minutes because helpers can see exactly what’s happening.
Platform-specific tips
Stack Overflow
- Search first. Your question has probably been asked.
- One question per post. Not “how do I do X and also Y?”
- Include a minimal reproducible example. Smallest code that shows the problem.
- Tag correctly.
[javascript] [react] [fetch-api] - Update the question if you find more info. Don’t just add comments.
Discord / Slack
- Use code blocks. Triple backticks: ```code```
- Don’t just say “hi” and wait. Ask your question upfront.
- Check #help or relevant channels instead of general.
- Search channel history first.
AI (ChatGPT, Claude, etc.)
- Paste the actual error. AI can parse stack traces.
- Include your code. AI can spot bugs directly.
- Provide context: “I’m using Next.js 14 with App Router”
- Ask follow-ups: “Why does that fix it?” to understand, not just copy.
- Verify answers: AI can confidently give wrong information.
GitHub Issues
- Check existing issues first. Might already be reported.
- Use the template if there is one.
- Include version numbers of the library and dependencies.
- Provide reproduction steps. “1. Install X, 2. Run Y, 3. See error”
The XY Problem
You want to do X. You think Y is the way. You ask about Y. But Y isn’t actually the right approach.
Bad: “How do I parse HTML with regex?” Better: “I need to extract all links from an HTML page. What’s the right approach?”
The second question might get “use a proper HTML parser” instead of a regex that will break.
State your actual goal, not just your attempted solution.
Before you ask
Checklist:
- Did I search for the error message?
- Did I check the documentation?
- Did I read similar questions on Stack Overflow?
- Can I reproduce this in fresh/simple code?
- Do I have the actual error message ready?
- Have I included the relevant code?
This isn’t gatekeeping—it’s that you’ll often find the answer while preparing the question. And if not, you now have a good question.
Getting answers faster
Be specific about versions
“React 18.2.0, Node 20.10.0, running on Mac”
Versions matter. Answers for React 17 might not work for React 18.
Include what you’ve ruled out
“It’s not CORS—same error without browser (using curl)”
Saves helpers from suggesting things you’ve tried.
Respond to clarifying questions
If someone asks for more info, provide it quickly. Stale questions get abandoned.
Mark solutions
If something works, say so. Update your question, accept the answer, or thank the helper. This helps future searchers too.
How to ask AI effectively
AI assistants are great for debugging but need context:
Weak prompt:
“Why doesn’t my code work?”
Strong prompt:
“I’m getting ‘Cannot read properties of undefined (reading ‘map’)’ in React.
jsxfunction UserList({ users }) { return users.map(u => <li>{u.name}</li>); }The component is called with
<UserList users={data?.users} />. Why does it crash and how do I fix it?”
This gives AI:
- The exact error
- The code
- How it’s being used
- A clear question
When to ask vs when to keep trying
Keep trying if:
- You haven’t read the error message carefully
- You haven’t searched for the error
- You haven’t checked the docs for the function you’re using
- You’ve been stuck less than 15-20 minutes
Ask if:
- You’ve genuinely tried and can explain what you tried
- The error message isn’t helpful even after searching
- You understand the problem but not the solution
- You’ve been stuck for over an hour on the same issue
There’s no shame in asking—but you learn more from struggle, and you get better answers when you’ve done initial investigation.
Further reading
- How to debug your code : Find the answer yourself
- How to read documentation : Check docs before asking
- Common error messages explained : Understand errors first
Frequently asked questions