There was a time, early in my career, when #GoodCode had a very specific and mechanical meaning. Namely, that your code was indented and formatted in a consistent and readable way so that you and others could understand it, find bugs easily, and make changes.
@evan We referred to it as "beautiful code is more likely to be correct". 20 years ago now, at Sony Mobile. Last time I remember participating in actual old school code review meetings with code having been printed out on paper and reviewed beforehand.
@evan remember the tabs vs spaces era?
I regard this as "necessary but not sufficient". π€
What I remember is that HTML used to look like that.
And then people started using layout tools instead of coding their websites.
And I cannot help but imagine the era of AI coding is going to be similar. π±
Except it won't be a silly website that doesn't hurt anyone if it breaks. It'll be running Air Traffic Control.
@TerryHancock it's largely your imagination. AI tools can call "lint" just like anyone else. They're also really good at identifying qualitative issues, like complexity of a function or coupling between modules. People who use AI for coding don't do it to produce bad code; we do it to produce better code.
Doing this work showed care and craft. If your code was well-indented, your brackets in the right part of the line, and your variable names consistent, unique, and informative, it meant you took code seriously.
For me, as a young programmer, this meant writing a lot of scripts, using regular expressions for global changes, and literally indenting code by hand.
Over the last few decades, this work has been largely automated. Linting utilities, which had once been used for debugging, became part of everyday development. IDEs did indenting and formatting automatically, and command line tools cleaned up anything they missed.
On top of this, arguments about the right way to format code have largely vanished. Teams adopt coding standards, and others like StandardJS or Python Black are formalised at the ecosystem level.
Standards are encoded in files in the repository, and enforced by local tools. Tools in CI/CD chains can detect, or correct, formatting errors for the entire tree.
I don't miss the days of personalised formatting tools and practices. I still get the same feeling of satisfaction from a successful lint result, without hitting space 1000 times and holding a straight edge up to my screen to see if my code lines up.
@tassoman does it help if I write "1/N" in the original post to understand that this is part of a thread?
@evan This is my definition of #goodcode and what I always strived to produce.