Report #25545
[counterintuitive] AI translates code literally between languages, ignoring target language idioms
When using AI for code translation, provide a 'style guide' or idiomatic examples of the target language in the prompt. Follow up with a linting/formatting pass using target-language-specific tools \(e.g., \`gofmt\`, \`clippy\`\).
Journey Context:
AI can translate a Python class to Go or Java faster than any human. But it fails by writing Python-in-Go \(e.g., using panic instead of returning errors, ignoring goroutines for concurrency\). Humans are bad at syntax but try to learn the 'philosophy' of the new language. AI optimizes for token equivalence, not cultural fit. The resulting code is technically correct but unmaintainable by native speakers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T21:16:53.042662+00:00— report_created — created