There's No Limit to How Bad Code Can Get
81–86 of 86 posts
Re: There's No Limit to How Bad Code Can Get
#82Re: There's No Limit to How Bad Code Can Get
#83Earlier quoted context omitted.
The problem with using LLMs to write Javascript is that they’re trained on Javascript written by humans. Which is not the training corpus I’d choose to teach a neural net to write code.
I laughed. Point noted. And yet, what do you have that's better? We could train it on a carefully-curated best-practices corpus, but that's likely to be considerably smaller. It might not have the breadth of coverage that one would wish for a training corpus.
Using Javascript is like prompting the LLM “You are a marginally competent developer…” Not that there are no good Javascript developers, but the average quality of JS code tends to be lower, encouraged by the language’s many misfeatures.
I’ve seen an LLM fix an import error in Python by wrapping it in an exception and trying a different import if it fails. Again, this is a function of the language’s weaknesses. In languages with good module systems, an LLM couldn’t do this because it’s typically not an available feature.
Re: There's No Limit to How Bad Code Can Get
#84Earlier quoted context omitted.
Yeah that's why step 0 is to tell the LLM to write a test suite for the thing you want to rewrite. It'll do that, but it does require adult supervision. Once you have that test suite, you can send the LLM into an inner dev loop. Like human programmers, LLMs are great when they have a fast inner loop. The fact that LLMs exist doesn't mean you can just stop thinking. It mean the things you have to think about will be d…
There’s a trap here though: the LLMs if you let them will spend all their time maintaining that test suite, they can become quite rigid in the way they design them. So it’ll write some code, break a test, which breaks a contract so then it updates the test and the contract but updating the test also broke another contract… soon enough you’re spending all your tokens fixing contracts instead of writing code. In a sens…
Re: There's No Limit to How Bad Code Can Get
#85The worst I have experienced: A 30,000-line .cs file. A giant monolithic program tangled together by Singleton abuse, 6-deep nested if/else blocks, and the list goes on. There are too many to count. And this is a sight I see every single day. This is the exact landscape I encounter at many companies when I go in for maintenance work. Encapsulation completely shattered as a direct reflection of the subcontracting powe…
I actually have no problem with most the code in one file vs. lots of little files. That said right click "Go to definition" is a lovely feature in VS.
Re: There's No Limit to How Bad Code Can Get
#86One of my first jobs, was as a maintenance engineer, on a 100KLoC+ codebase of 1979s-era FORTRAN IV. No comments. No subroutines (what we now call “functions”). No variable name longer than 4 characters. Fun. The most effective debug tool, was a Ouija board. It made me an expert WAGger. It was the main reason that I am so anal about code Quality, these days. I never want to subject anyone else to that. BTW: with toda…
And basic formatting was solved years ago and also not an issue.
Code organisation on the other hand is as difficult as ever before, if not more.