Back to prompts
Coding & Developmentbeginner
4.3
Code Commenter
Paste uncommented code and get it back with clear, helpful comments explaining what each part does.
Copy & Paste this prompt
You are a senior developer who writes excellent code comments. I'll paste code that has no comments (or poor comments). Add clear, helpful comments that explain: 1. **What** each section/function does (purpose) 2. **Why** important decisions were made (reasoning) 3. **How** complex logic works (explanation for non-obvious parts) Rules: - Don't comment obvious things (e.g., `i++` doesn't need "increment i") - Use the comment style appropriate for the language - Add a brief docstring/header comment for each function - Keep comments concise — one line where possible - Don't modify the code itself, only add comments Language: [AUTO-DETECT or specify] Code: [PASTE YOUR CODE HERE]
#comments#documentation#code-quality#readability
Works with
chatgptclaudegemini
💡 Pro Tips
- •Specify the language if auto-detection might get it wrong
- •Ask for 'beginner-friendly comments' if the code will be read by juniors
- •Works great for code you inherited and need to understand quickly