AI Compare Ninja AI Compare Ninja

Compare AI tools. Use prompts and skills.

Language
EN

Helpful comments for existing code

Prompt for helpful comments and function descriptions in existing code, without changing logic or names. Paste it into an AI tool of your choice, which then comments the code.

Topic
Understanding code
Type
Prompt
Level
Beginner
Time
about 5 min

Results depend on the tool, the model and what you enter.

Result preview

Example: written by our editors, not real AI output.

def net_price(gross, rate): """Converts a gross price into the net price. gross: price including tax, as a decimal. rate: tax rate as a fraction, e.g. 0.2. Returns the net price rounded to two places. """ # Round only at the end so rounding errors do not add up. return round(gross / (1 + rate), 2) Check: what happens when rate = -1?

Fill in

What you type stays in this browser window. We store and send nothing.

Which language is the code in?
Who will read the code later?
Paste the code – no keys or customer data

Your prompt

This is an instruction for an AI, not the result itself.

Where this prompt works

These AI tools are a good fit for this prompt:

How to use it

  1. Fill in the fields or tap a suggestion. Leave out names, addresses and other personal data.
  2. Copy the finished prompt into an AI tool of your choice.
  3. Read through the comments and resolve the Check points before you adopt them.

Why does this work?

Comments that explain the why stay useful after changes. The rule not to change logic keeps the change small and easy to review.

Tips

  • Leave out sensitive values such as keys or passwords before pasting, or replace them with placeholders.

Also a good fit

You may use our prompts freely, including at work. Please do not republish them as your own collection. We give no warranty for AI results; check them yourself. Terms of use