Remove unnecessary, redundant, or obvious code comments while preserving valuable explanations. Use when cleaning up comments, removing verbose documentation, simplifying inline comments, or preparing code for review.
This guide is for removing unnecessary, redundant, or obvious code comments while preserving valuable explanations. Use this when cleaning up verbose documentation or preparing code for review.
// increment counter above counter++)When reviewing code, ask yourself:
# Increment the counter
counter += 1
# Check if user is None
if user is None:
return
# Loop through items
for item in items:
process(item)
# Use exponential backoff to avoid overwhelming the API
# Max retries: 3, delays: 1s, 2s, 4s
retry_with_backoff(api_call)
# IMPORTANT: Must validate before save to prevent orphaned records
# See issue #1234 for context
if not validator.check(data):
raise ValidationError
# Performance: O(n log n) - don't change to bubble sort
quicksort(data)
# Before:
# This function calculates the total price by iterating through
# all items in the cart, multiplying each item's quantity by its
# price, and then summing all the results together to get the final total.
def calculate_total(cart):
return sum(item.quantity * item.price for item in cart)
# After:
# Includes bulk discount calculation for quantities >10
def calculate_total(cart):
return sum(item.quantity * item.price for item in cart)
The output should be the cleaned code with only high-value comments remaining. Each preserved comment should answer questions that the code itself cannot.
Remember: The best comment is often no comment when the code speaks for itself.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer