Respect Your Pre-Flight Checks
Part 1 of 3 · Pre-Flight Checks
- Respect Your Pre-Flight Checks
- Build a Clean, Coherent Change
- Run Your Checklist Before the PR (coming soon)

The story
Since the inception of software engineering as a trade we've been trying to go faster. We've built better compilers, more expressive languages, abstracted away mountains of complexity and generally taken every opportunity to deliver value faster.
At some point, code stopped being the bottleneck and the delivery process took its place as the bane of our existence as professionals. However painful that is, it's a fact of life and we have to respect it.
If you've been doing software development for any meaningful amount of time, something like this has happened to you. And if it hasn't yet, it will. You push your final commit, you feel the dopamine hit of work well done and then...it's red. The pipeline you've been waiting on for the last fifteen minutes has failed on a trivial step.
Maybe it's linting. Maybe it's a tiny test you forgot to update. It feels so small. So inconsequential. Nonetheless, you just threw some time you are never getting back into the abyss. You fix it quickly and run it again and now it's green, but it's taken a piece from your sense of accomplishment.
You think "Surely we can do better than this?"
The answer is yes. It's incredibly rare for a tiny 5-line change to be problematic. Most probably things spun out of control well before the red pipeline.
I am going to make a bold claim that the issue started before the first line of code even hit the disk. It was doomed from the start.
Let me walk you through it.
The idea
This kind of failure is almost never about intelligence. It's about ignoring pre-flight checks.
What are the pre-flight checks? In a literal sense, it's a list of things to confirm before an aircraft is cleared to take off. Pilots and engineers follow them to the letter to avoid accidents. In an environment as complex and unforgiving as air travel, disciplined checklists are still one of the most reliable safety tools we have.
Two parts of this approach apply directly to our industry.
First, pilots never skip their checks. It doesn't matter if it's their first flight or they've flown that route a thousand times.
Second, they never skip steps within those checks. Even if it's a short flight on a sunny day, the discipline wins.
As engineers, we shouldn't either.
With the latest advances in AI, it's trivial to feel like a 10x dev shipping dozens of changes every Sprint. It makes you feel like a hero, solving everyone's problems and delivering immense value in extreme timeframes.
That feeling is a trap. Without a proper process, you are just digging a hole for yourself with heavy machinery.
Boring habits beat heroics any day of the week, and it's not even close.
There are three parts to this:
- Know Exactly What You Are Building - confirm the work deserves to exist (This one)
- Build a Clean, Coherent Change - review your work as you go to keep the change focused and coherent
- Run Your Checklist Before the PR - verify the boring stuff locally
Let's get to it.
Know exactly what you are building
Before breaking ground on a piece of work, there are a few things that you need to check as the bare minimum:
Must it exist?
For us as engineers, it is tempting to solve every problem with code. It is fun, it is a challenge and the feeling of creating something out of nothing is enticing. However, any amount of code adds complexity, and complexity is bad.
Sometimes, answering this question means looking up external tools like packages, asking a more experienced colleague, solving an issue with a change to a process, documentation or a piece of infrastructure...or just doing exactly nothing. Yes, that is an option too. Often it is the best one.
Likely candidates for culling on inception include:
- Anything to do with scaling and performance unless there are stats or metrics that prove the value e.g. you don't need a load balancer for your blog.
- Complex patterns that solve a problem that is encountered exactly once in the codebase e.g. you don't need an abstract factory for your record of five fields.
- Virtually anything to do with custom security or auth. Don't. Just don't.
- Features that were never requested or spoken of by the user base e.g. you don't need multiple themes for a dashboard that 10 people use on a good day.
- Anything that allows modularity or hot-swapping unless there are multiple usages in the codebase already, e.g. you don't need an
IComplicatedBackendPaymentGatewayProviderif you only ever plan on supporting Stripe. - Considerable code commitments that solve a niche edge case unless it's a core value proposition of the product, e.g. you don't need a custom AI overlay to translate your website into every dead language known to man.
After considering whether the thing should exist, restate the problem in your own words. It is a great feasibility test for technical problems. If it sounds worthless when you strip off all of the technical details and jargon, you might need to rethink your approach or drop it.
Has it earned its right to exist? Excellent, let's decide how much space it's allowed to occupy.
How big exactly must it be?
Any piece of software can be improved upon infinitely until the heat death of the universe. It is important to draw the line somewhere and stick to it.
It is especially important when working on an unfamiliar codebase or when you lack experience. A good scope check can turn a mammoth PR into a couple of focused, functional changes.
You can ask two people to look at the same exact set of requirements and get two wildly different estimates. The answer is to narrow it down until consensus is reached.
This is also something that you should reassess as you go through the piece. That code cleanup over 40 files that you thought was neat alongside your tiny change to the service? Yeah, that goes into its own piece of work unless you want the reviewer to despise you indefinitely.
In practice, this is likely to be captured in your acceptance criteria or a brief note on the issue documenting the exact scope of the change.
Let's consider an extreme example. A few years ago I was working on a codebase that had over fifteen thousand (yes, not a typo, five digits) static analysis warnings. We got a seemingly inconspicuous task titled Decrease analyser warnings. If you assumed that any sane person would read that as Do your best during the Sprint - that's not what happened. The poor bloke assigned that ticket battled for over a month to fix them all. Kudos to his patience, shame on us for not getting suspicious sooner.
Some red flags to look for when deciding how big is too big:
- You are changing more than one behaviour or fixing more than one bug at a time, e.g. bumping all packages in the project to the latest major version is probably pushing it.
- You consider making architectural changes to the project without planning them in advance.
- You consider warning your colleagues in advance that they will need to allocate some serious focus time to review your PR.
- You touch multiple disconnected parts of the system in a single change.
But before going any further as part of your planning you should ask yourself...
Do we already have that?
Who doesn't love a greenfield project? Starting from scratch is exciting and fun. However, as you are frolicking through the meadow, remember that unless the project is a literal empty folder, someone has probably already done something very similar to what you are trying to do.
The hard truth is that outside of the domain logic and complicated algorithmic solutions, there are not many truly unique problems out there. And it pays off to be consistent in how we solve them.
What actually helps?
- Look around for a similar pattern: If you are writing a service, look into another service for examples on responses, error handling and naming conventions. If you are creating a table in the UI, look into other files that might have one. Generally, it's a good idea to look into multiple places, otherwise you run the risk of spreading the bad code further.
- Look for utility or helper classes: They are usually born of pain and suffering of many devs before you. Use them. Extend them. Challenge them if you think you know a better way.
- Check the doco: If your team is diligent enough with documenting how they do things, you can get answers to most common questions relatively easily. I don't recommend this step on its own. Documentation tends to go stale rapidly.
- Ask a mate: In the perfect world the code is readable, architecture is clear and docs are up to date. The real world is dark and full of terrors. Your mate has likely hacked through some of it and can shed some light on the ins and outs of the codebase. If that is genuinely something novel, you can brainstorm the approach together.
- Ask your AI overlord: They are generally good at summarising what's going on or finding relevant bits and pieces. Even if you can't find an existing approach - it might suggest industry-standard solutions with a rigorous enough prompt. Take everything that comes out of a clanker with a grain of salt and make sure you understand the suggestions. Don't trust them blindly. If you can't do it yourself, don't get AI to do it.
"But why? My shiny new code is awesome!"
A few things come to mind:
- Existing code is likely battle-tested. It's been there for some time and hasn't caused problems. That kind of assurance is hard to come by.
- You make your solution easier to read and review and save time for yourself and the reviewer. Novelty adds cognitive complexity, use it sparingly.
- Existing code likely has tests already. You need less of your own for the final piece. Free coverage.
- You make your code easier to digest for the AI. Having a single approach used everywhere makes it less likely to go wildly off track.
- You make onboarding easier for the next dev. Save the pain, share the love.
Congrats! Having followed those steps, you've decreased the chances of your pipeline exploding by making a smaller, targeted change.
We've done a lot of thinking, let's get to coding.