Monday, November 10, 2025

Why AI Thinks Every Language is JavaScript

“Ask ChatGPT to write C code and it’ll give you Python with semicolons.”
AI coding tools have a dirty secret: they’re brilliant at some programming languages and barely competent at others. The difference isn’t random - it’s a direct result of what they were trained on.
And what they were trained on is overwhelmingly JavaScript and Python.

TL;DR: AI coding quality varies dramatically by language. It’s brilliant at JavaScript and Python, barely competent at C and specialized languages. Most developers don’t realise why - or implement the language-specific governance needed to compensate. We help organisations get their language-aware governance right.

The Training Data Bias

Large language models learn from publicly available code. GitHub is their textbook. Stack Overflow is their tutorial site. Open source repositories are their practice exercises. This means they’re exceptionally good at the languages that dominate those sources: JavaScript, Python, TypeScript, Java. Millions of examples. Every pattern thoroughly represented. Every common mistake documented and corrected.

Then ask them to write C and watch what happens.

What Goes Wrong

AI doesn’t understand memory management in C. It generates code that would work fine in Python or JavaScript but creates memory leaks or buffer overflows in C. It uses patterns from garbage-collected languages in a language where manual memory management is critical. Ask for Delphi code and you’ll get something that superficially resembles Object Pascal but violates fundamental language conventions. It’ll suggest C-style pointer arithmetic where Delphi uses different patterns. It’ll miss the language’s string handling idioms entirely.

The code compiles - sometimes. It doesn’t feel like idiomatic code written by someone who actually knows the language.

Real Examples
  • C Memory Management: AI will malloc() without free(), write to pointers without null checks and create structures that leak memory. It understands the syntax but not the discipline.
  • Delphi String Handling: AI treats Delphi strings like C strings, missing the language’s sophisticated built-in string management. It generates code that works but ignores decades of language evolution.
  • Embedded Systems: Ask for code that respects hardware constraints and timing requirements. You’ll get something that might run on a server but fails on actual embedded hardware.
  • Assembly Language: AI generates assembly that compiles but doesn’t optimise for the target architecture. It writes code like a compiler would generate, not like an expert systems programmer would craft.

The JavaScript-ification Problem

Here’s the pattern: AI tries to solve every problem using JavaScript/Python patterns, then translates to your target language’s syntax.

This produces code that technically works but misses language-specific optimisations, idioms and best practices. It’s like asking someone who only speaks English to write poetry in French using a dictionary. The words are correct. The rhythm is wrong.

When AI Actually Helps

For well-represented languages (Python, JavaScript, TypeScript, Java), AI coding tools are genuinely useful. The training data is rich enough that the AI understands not just syntax but idioms and patterns. For less common languages or specialised domains (embedded systems, legacy languages, hardware-specific code), AI becomes a liability. It generates plausible-looking code that experts immediately recognise as wrong.

What This Means for Your Team

If your stack is Python and TypeScript, AI coding tools will boost productivity. The generated code will often be good enough to use with minor modifications.
If your stack includes C, embedded systems or legacy languages, AI coding tools require expert oversight. Junior developers using AI to write C are learning bad habits. Senior developers can use AI for boilerplate but need to heavily review and refactor everything it generates.

The Governance Challenge

During Orange Octopus development, I worked primarily in languages AI handles well. Even there, governance was critical - documentation structure, specification clarity, consistency enforcement. For teams working in less-represented languages, the governance requirements are even more stringent. You need: 

Language-Specific Documentation: Explicit style guides that AI can follow, not assume. Document memory management patterns, string handling conventions, hardware constraints.
Expert Review Protocols: Every AI-generated implementation needs review by someone who actually knows the language idioms. Not just “does it compile” but “is this how we’d write it.”
Training Examples: Build internal reference implementations that demonstrate correct patterns in your specific language. Use these to guide AI rather than relying on its biased training.
Testing Discipline: Comprehensive testing becomes even more critical when AI might generate syntactically correct but idiomatically wrong code.

Getting Your Language-Specific Ducks in a Row

Most organisations using AI coding tools don’t realise how much language bias affects output quality. They assume all languages work equally well. They discover otherwise when technical debt accumulates.
The solution is language-aware governance:
  • Explicit documentation of language-specific patterns AI should follow
  • Reference implementations demonstrating correct idioms
  • Review protocols that catch language-inappropriate patterns early
  • Testing frameworks that verify not just correctness but idiomaticity
This is particularly critical if you’re working in multiple languages. AI might handle your JavaScript brilliantly while generating problematic C code - and without proper governance, you won’t notice until deployment.

The Lanboss Perspective

At Lanboss AI, we help development teams implement governance frameworks that account for language-specific AI coding challenges.
Through our AI Coding Governance Implementation service, we:
  • Assess how well AI tools handle your specific language stack
  • Develop language-specific documentation and style guides for AI consumption
  • Establish review protocols appropriate to your language’s complexity
  • Train teams on governance practices that prevent language-inappropriate patterns
The goal is ensuring AI coding tools deliver value regardless of your technology stack - not just for the JavaScript developers.



No comments:

Post a Comment

Why AI Thinks Every Language is JavaScript

“Ask ChatGPT to write C code and it’ll give you Python with semicolons.” AI coding tools have a dirty secret: they’re brilliant at some pr...