software-design/

Architecture, patterns, testing, refactoring and code review.

7 results
software-design/feature-flags-how-to-ship-code-switched-off-and-turn-it-on-for-10-of-u.md Feature flags: how to ship code switched off and turn it on for 10% of users A feature flag is a yes/no setting your code checks before choosing between old and new behaviour, so you can ship code switched off and… 5 min read · 2 Nov software-design/refactoring-how-to-tidy-working-code-without-breaking-it.md Refactoring: how to tidy working code without breaking it Refactoring means changing how code is built on the inside without changing what it does. It sounds risky, but there is a simple routine… 6 min read · 24 Oct software-design/unit-tests-why-four-passing-tests-don-t-prove-a-function-works.md Unit tests: why four passing tests don't prove a function works Your function gave the right answer four times. Is it correct? Not necessarily: passing tests only show the bug isn't where you looked… 4 min read · 21 Oct software-design/idempotency-why-clicking-pay-twice-should-charge-you-once.md Idempotency: why clicking Pay twice should charge you once You tap Pay, the screen shows an error, you tap again, and your card is charged twice. Networks drop messages, so a phone often cannot tell… 6 min read · 18 Oct software-design/state-machines-why-an-order-can-t-be-delivered-before-it-s-paid.md State machines: why an order can't be delivered before it's paid An online order can be in the cart, paid, shipped, delivered or cancelled, but what stops the code from delivering an order nobody paid… 4 min read · 15 Oct software-design/refactoring-tidy-messy-code-without-breaking-it-using-tests-as-a-net.md Refactoring: tidy messy code without breaking it, using tests as a net Refactoring means changing how code is written without changing what it does, so the next person (often you) can read it. It sounds risky… 5 min read · 6 Oct software-design/your-first-unit-test-catch-the-leap-year-bug-a-quick-check-misses.md Your first unit test: catch the leap-year bug a quick check misses A unit test is a tiny piece of code that checks another piece of code: you pick an input, write down the answer you expect, and let the… 5 min read · 3 Oct