A guide to askingInclude code and errors

Show the problem.
Include the code and error.

Instead of “my code does not work,” share a small, runnable example of the problem, together with the expected and actual results.

About a 2-minute read

A conversation that stalls

Sara

I wrote some code to send email, but it does not work. What is wrong?

Without code, errors, and environment details, answers are mostly guesses.

A question someone can answer

Sara

This request should succeed, but returns 401: fetch("/api/send", { method: "POST" }) The endpoint requires login. I have not cleared my session cookie. What should I check in the request?

There is a concrete example to investigate.

Small, complete, and reproducible

Remove unrelated code, but keep everything needed to reproduce the issue. Include tool versions, steps to run it, the complete error, and how the actual result differs from what you expected.

Share code as text in a code block so it can be read, searched, and run. A screenshot can add context, but should not replace the code or error text.

Replace passwords, tokens, and real user data with sample values before sharing. Run your example once to make sure it still reproduces the problem.

Before you send your question

0 of 4 ready
A starting point for your next question
Keep the conversation goingThe best programming language

Other projects

Other projects for people who like to learn and build.

Sources and inspirationDon’t Ask to AskNo HelloThe XY ProblemMinimal, Reproducible ExampleTheBestLanguage