Field notes from the review team
Learn to ship code that survives
The mistakes every team makes — in the code we write and the code we generate — and how to catch them before they ship. Friendly, concrete, ten minutes at a time.
Backend
Correctness, data access, and the services behind the API
Duplication Is Cheaper Than the Wrong Abstraction
We built a beautiful, flexible exporter framework to avoid writing three similar classes. Two years later, everyone was afraid to touch it. On the rule of three and earning your abstractions.
When Your AI Assistant Invents an API
The method looked perfect: well-named, idiomatic, exactly what the task needed. It also didn't exist. On hallucinated APIs, wrong-version code, and verifying what you merge.
Two Requests Walk Into a Bar: Race Conditions in Ordinary Web Code
The coupon was single-use. It got used 217 times in one weekend. On check-then-act bugs, why your code has more concurrency than you think, and the fixes that actually hold.
Where Does Business Logic Actually Live? A Field Guide
The create action was 180 lines and touched four models, two APIs, and a mailer. Nobody wrote it that way — it grew. On thin controllers, honest service objects, and gods.
Every External Call Will Fail. The Only Question Is How Gracefully.
A payment provider's slow Tuesday took down our whole app — not because they errored, but because they didn't. On timeouts, bounded retries, and circuit breakers.
Your API Is Leaking: Over-Serialization and the Contracts You Didn't Mean to Sign
render json: @user feels harmless until a column you added for internal bookkeeping shows up in a partner's integration. On accidental contracts and serializing on purpose.
rescue Exception and Other Ways to Hide the Body
The scariest bugs aren't the ones that crash — they're the ones that get rescued into silence. On swallowed errors, overly broad rescues, and failing in ways you can debug.
Migrations That Don't Take Production Down With Them
A migration that runs instantly on your laptop can lock a hot table for minutes in production. How to ship schema changes that coexist with running code.
Your Background Job Will Run Twice. Plan for It.
Queues promise at-least-once delivery, and 'at least' is doing heavy lifting. How to design jobs — especially the ones that touch money — to be safe to run again.
The N+1 Query: Death by a Thousand SELECTs
The page worked fine with ten records and fell over with ten thousand. A field guide to spotting the N+1 query hiding in your loops, serializers, and helpers.