Remix.run Logo
altern8 7 hours ago

Might be because there are less Swift projects to train with.

But I've seen Claude write crazy code in Python and JavaScript, too

ChrisMarshallNY 7 hours ago | parent | next [-]

My theory is that most of the Swift code in the public domain, is basically demo code. Short, idealized, code samples to demonstrate issues and solutions; much like you would see in StackOverflow.

PHP has huge, entire frameworks and systems, refined over years.

graemep 7 hours ago | parent [-]

There is also a lot of low quality PHP code out there, and a lot of legacy code in a language that I am told (I have not used if for years myself though) has changed a lot.

ChrisMarshallNY 7 hours ago | parent [-]

Same with C++. You don't want to write C++, the way that I used to.

That's one of the things that I appreciate about the PHP that the LLM provides. It uses modern idioms that make better use of the modern language.

graemep 7 hours ago | parent | prev [-]

I do not know about crazy, but certainly sub-optimal. For example a loop over DB query results instead of modifying the code to work with a single query.

ChrisMarshallNY 7 hours ago | parent [-]

I found that asking it to refactor for performance and safety often addresses these issues.