Strong Coding Opinions

SummaryA collection of opinions that I've developed during my career as a Software Engineer

I am still barely getting started with my career, but I've worked alongside enough engineers to start recognising patterns. Everyone has a modus operandi — in criminology, it's the method that gives a perpetrator away; in software, it's the fingerprints they leave all over a codebase. I've come to think of these patterns as placing people somewhere on a spectrum, ranging from raw programmer to software engineer. Some of these M.O.s are, in fact, crimes

The Rules§

These aren't suggestions. They're the things I've watched people ignore and then regret.

Code that is not checked into version control does not exist.

I have personally watched someone spend three days tracking down a bug, fix it, and then lose the fix because it was never committed. When something goes wrong at 2am and you need to roll back, "I had it working locally" is not something you can deploy.

Legacy code is code without tests.

The uncomfortable corollary is that you may be writing legacy code right now. Tests aren't just documentation — they're the only proof that your code does what you think it does. Without them, every refactor is a leap of faith and every deployment is a prayer. (Further reading)

Automate what's possible.

The argument against automation is usually "it's faster to just do it" — and it is, the first time. The argument stops making sense around the third time. If you've done something manually more than twice, you should have automated it the first time.

Code is never correct the first time.

The first version is always a draft. Ship it, find out where it breaks, and fix it. The only question is whether you discover the bugs during development or in production. Preferably development

Readability is not optional.

You will spend far more time reading code than writing it. Code that is hard to follow is technical debt from the moment it is committed. A clever trick that saves three lines but takes twenty minutes to parse is not a win — it's a trap for the next person, who is often you, six months later.

If it isn't in a ticket, it doesn't need to be done.

Undocumented work is the source of most scope creep, missed deadlines, and "I thought you said" arguments. If something is worth doing it's worth being able to point to it. This also protects you — invisible work is invisible credit.