Hacker News new | ask | show | jobs
by spiderfarmer 20 hours ago
> I program in PHP all day, I know. PHP is a bad language for LLMs.

That statement is so absurdly false that I'm fully convinced you never used an LLM for serious PHP development.

1 comments

I use an LLM every day on a codebase that’s at least 10 million lines long.

LLMs perform poorly in huge monoliths (not enough context) and they perform poorly in PHP (not enough context in the code). It’s just intrinsic to how LLMs work.

Can you explain what about PHP has less context? Are you working in a PHP codebase with no types?
Even with types the code does not have enough context.

You can type a variable as array. Now what's in? You don't know unless you read a lot of code.

You can type a variable as a class. Now what's in it? You still don't know, because properties and methods may be dynamically added in various code paths. What methods can you call on this class? You don't know, because it uses magic methods for resolution.

You see a variable in a function. Is it defined? What's it's value or type? You don't know, because there are no local types in PHP. And you don't know if the variable is defined because it could have been defined 3 layers of nesting deep in the function. You have to read more code to find out.

You call a function. Is it defined? You don't know, because it could have been included in an include() somewhere else in the class or function.

You just have to read 10x as much code to get the same amount of context that a language like C# gives you for free via the compiler.