by ChrisMarshallNY · 2mo ago · 0 comments
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 today’s LLMs, there’s really no excuse for badly-documented, or badly-formatted code. You can write a thousand lines of commercial-grade spaghetti, and tell the LLM to format and document it.
I'd phrase it differently; we're now able to accumulate technical debt faster than ever, without even building the institutional knowable needed to keep it sane. While the models writes novels about what it's doing that no human or LLM will find any use for.
But at the same time; if the LLM makes coding 5-10x faster, there's plenty of left-over time we can now spend doing things properly. Document, test, plan, refactor, lint, use CI tooling. There is no excuse now that LLMs reduce the pain threshold for all of them.
LLM's just enable you to speed run your way into a legacy code base.
> without even building the institutional knowable needed to keep it sane
Does feature XXX move the needle? Did you gain more business or retain existing business because a feature exits? Has AI tooling helped your product team move the needle? No? Why not?
How easy is it to remove the feature that NO ONE uses is a question no one is asking. How many people got promoted for "removing the most garbage" from the system?
We, as an industry, might need to have a candid conversation about what we're doing and how we do it.
How do you properly measure this? Do you setup a database that monitors when every feature is used? Is the feature only used once a year for some reason? Is the feature only used on some rare data that is uncommon but still can occur?
And that really applies to something fully in your control. In systems controlled by customers its far harder.
The same way you measure utilization and cost at a customer level.
I can name at lest three companies where their biggest clients are also the bulk of their costs - they lift revenue but drag the margins. I can name another couple who spent years marking their products entirely wrong because they simply had no clue how their product was really being used.
> Is the feature only used on some rare data that is uncommon but still can occur?
This is where the competence of your product team comes into play. We're building features faster with AI but none of it is moving the needle. That has little to nothing to do with code quality, and everything to do with product teams.
As a technological innovation theyre a bit like amphetamines for code. Sure, maybe some people are using the "tankers chocolate" their employer handed them responsibly...I guess.
There are certainly a lot of people online who have gone all in who swear blind theyre not abusing them.
100KLoC sounds like paradise compared to the latest codebase I touched. Having the signal to noise ratio fluctuate wildly at every member & file is highly distracting. When the information is dense and consistent, you can drop into a flow state more easily.
Four character variable names might sound awful but they can have an advantage. It's a form of compression once you are adapted to it. It forces you to keep things simple. When we can write an entire novel for a variable name, we may be tempted to inflate the scope of a solution.
No comments is universally a feature. If I want justification for a section of code, I am going to check git blame, PRs, linked issues, email, project management system, etc. The only code comments I value less than those written by humans are those written by LLMs. It is beyond pointless to shit up a codebase with this stuff. You could just ask the LLM to give you a live interpretation of the current state of the code instead of risking something falling out of sync.
Every now and then, I'll insert a "why" comment, if I feel it's necessary.
I wrote about my technique (and reasons), here: https://littlegreenviper.com/leaving-a-legacy/
But that's what stackoverflow looks like.
And how do you know that the documentation is correct? Because if it's not, it's worse than being absent. The verification work sounds close to as hard as writing it in the first place.
This is what I never grasp when people suggest LLMs for anything precise (outside of cases where the LLM output is in a machine-verifiable language).
Good times.
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.
Yes, you can tell the LLM to format and document it. You can also tell an effigy of Richard Nixon, or write it on a piece of paper and burn it. Of course you can do such things, but the important question is what that gains you.
Yesterday I vibe slop coded something, being very lazy about it, it being a throwaway experiment. Gemini wrote this for me:
span.onclick = (e) => {
e.stopPropagation();
loadFolder(node.fullPath);
};
li.appendChild(span);
if (node.children && node.children.length > 0) {
node.children.forEach(child => li.appendChild(renderTree(child)));
}
ul.appendChild(li);
return ul;
}
async function loadFolder(folderPath) {
Note the function name "loadFolder", and the short distance between the definition and where it gets called... So after a bunch of other changes, one change it made completely broke everything. I didn't check any of the code, but just described the symptoms etc.first fix attempt:
// Call your backend loader safely
if (typeof loadFolderFiles === "function") {
loadFolderFiles(nodePath);
} else if (typeof loadFiles === "function") {
loadFiles(nodePath);
}
second fix attempt: // Call your app's existing folder loader
if (typeof loadFolderFiles === "function") {
loadFolderFiles(nodePath);
} else if (typeof loadFiles === "function") {
loadFiles(nodePath);
}
third: // Call backend loader
if (typeof loadFolderFiles === "function") {
loadFolderFiles(nodePath);
} else if (typeof loadFiles === "function") {
loadFiles(nodePath);
}
and finally:> Most likely, your original code either passed childNode to a function like selectFolder(node) or sent a specific fetch() request. Here is the updated renderTree function [..]
if (typeof selectFolder === "function") {
selectFolder(childNode);
} else if (typeof onFolderSelect === "function") {
onFolderSelect(nodePath);
} else if (typeof loadFolderFiles === "function") {
loadFolderFiles(nodePath);
} else if (typeof loadFiles === "function") {
loadFiles(nodePath);
} else {
// Direct API fetch fallback if your backend uses a standard endpoint
fetch(`/api/files?path=${encodeURIComponent(nodePath)}`)
.then(res => res.json())
.then(data => {
if (typeof renderFileList === "function") renderFileList(data);
})
.catch(err => console.error("Error fetching folder files:", err));
}
I can only imagine what is going on out there right now, but I fully assume most of it is not very good, lots of it horrifying crap that technically, kinda works.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.