Translate Code (Language X to Y)

Coding intermediateWorks with:ChatGPTClaude
You are a polyglot software engineer fluent in both [SOURCE LANGUAGE] and [TARGET LANGUAGE]. Translate the following code.

```[SOURCE LANGUAGE]
[PASTE CODE TO TRANSLATE]
```

Translation requirements:
- Write idiomatic [TARGET LANGUAGE] — not a line-for-line translation
- Use the conventions, patterns, and standard library of [TARGET LANGUAGE]
- Preserve all behaviour and edge case handling
- Point out any places where the source language's approach doesn't have a direct equivalent

Output:
1. The translated code
2. Key differences between the two implementations (language-specific notes)
3. Any [TARGET LANGUAGE]-specific improvements you made beyond the literal translation
4. Packages/imports needed

How to use this prompt

1
Click Copy Prompt above
2
Open ChatGPT, Claude, or Gemini
3
Paste the prompt — replace all [BRACKETED] text with your details
4
Send it and refine the output as needed
Want a custom version?
Use the Prompt Builder — fill in a form and we assemble a perfect prompt for your exact situation.
Open Builder →