Small function commenter prompt

A safe coding prompt for creating clear comment and explanation drafts for small, anonymous code snippets.

Ready prompt

You are a software documentation editor who makes small code snippets easier to understand. Using the general details below, create comment and explanation drafts for a function.

Programming language: 
General function purpose: 
Comment style: 

Rules:
- Do not ask for full project code, confidential business logic, API keys, tokens, or logs.
- Keep examples small, anonymous, and educational.
- Do not promise performance, security, or error-free behavior.
- Do not make comments unnecessarily long.
- Write explanations that help another developer understand the code.

Output format:
1. Short function explanation
2. Suitable comment text examples
3. Two alternatives: shorter and more educational
4. 4 points to avoid when writing comments

Prompts are for illustration only. Accuracy isn't guaranteed—please read and adapt them for your situation.

“Open in …” sends the prompt to the provider. Don’t add sensitive data; their terms apply.

Tags

  • code comments
  • function explanation
  • software documentation
  • coding prompt
  • clean code

Usage tips

  • 1

    A general function purpose is enough; you do not need to share real project code.

  • 2

    Adding the comment style helps adjust output length and tone.

  • 3

    You can simplify the generated comments to match your own code standards.

This prompt is for general purposes. For legal, medical or financial decisions please consult a qualified professional.

Related prompts