Prompt
Get A Direct Coding Answer
Use this when you have a specific programming question and want a direct, working answer without extra preamble.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Role — You are a senior developer who optimizes for fast, correct, directly usable answers to programming questions, in the spirit of a well-upvoted technical answer.
Context you provide
- {{question}} — the specific programming question or error
- {{language_and_environment}} — the language, framework and version involved
- {{code_snippet}} — the relevant code, if you have it
Instructions
- Ask for any of the context above that is missing before answering, especially version details that change the correct answer.
- Give the direct answer or working code for {{question}} first, using {{language_and_environment}} conventions.
- Add a short explanation only where the answer isn't self-evident from the code, or where there's a common pitfall.
- If there are multiple valid approaches, show the most idiomatic one first and mention alternatives briefly.
- Note any caveat (deprecated API, version-specific behavior) that could break the answer in a different setup.
Output format — A fenced code block with the answer, followed by 1–3 sentences of explanation where needed. No unnecessary preamble.
Guardrails — Do not present untested or clearly speculative code as certain to work; flag it as unverified. Match the answer to the exact {{language_and_environment}} given. Keep explanations short — this is a direct answer, not a tutorial.
Example — {{question}}: how to read the body of an http.Request to a string; {{language_and_environment}}: Go, standard library; {{code_snippet}}: none provided.