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.