Good Code Isā
Published on JulĀ 23, 2023, filed under development (feed). (Share this on Mastodon orĀ Bluesky?)
I just discarded a 1,000-word response to Addy Osmaniās notion that good code was like a love letter (to the next developer maintaining it).
I discarded it because I didnāt end up enjoying, didnāt feel humble challenging something of good intention; and yet here we are with a post, about something seemingly old and obvious no less.
The Eternal Question
What is good code?
Is good code (like) a love letter?
Maybe.
If you ask me, a frontend developer, it starts with valid, semantic, accessible, required-only HTML, but agreement on each of these adjectives variesāāaccessible,ā yes, āsemantic,ā sure, āvalid,ā in theory, yes, but in practice, no, and when it comes to omitting optional markup, no thanks, the popular vote goes to XHTMLāHTML.
So?
I doubt we can define āgood code,ā and wonder whether itās definable.
Not because of disagreement, as suggested with HTML (and HTML alone), but because the terms are too charged and too broad.
āGoodā and āCodeā
āGoodā comes with a ton of value judgments, each of which has reasons and sponsors. (āGoodā has substantial problems, in case youād like my latest book.)
āCodeā first comes with a ton of languages, each with its own history and best practices.
And when you turn your head and observe the field, neither may matter.
What does āgoodā mean when things workāfor the users, the developers, the business?
What does ācodeā mean when it changes with the windādevelopers switching frameworks, languages, paradigms?
ā§ If we canāt answer what āgood codeā is, what can āgood codeā be like? A love letter?
And you notice, that comparison (or verification of it) may not be the question.
What good code is, that is the question.
Maybe itās more interesting than the answers.
About Me
Iām Jens (long: Jens Oliver Meiert), and Iām a web developer, manager, and author. Iāve been working as a technical lead and engineering manager for companies youāve never heard of and companies you use every day, Iām an occasional contributor to web standards (like HTML, CSS, WCAG), and I write and review books for OāReilly and Frontend Dogma.
I love trying things, not only in web development and engineering management, but also in other areas like philosophy. Here on meiert.com I share some of my experiences and views. (I value you being critical, interpreting charitably, and giving feedback.)