Forget Defensive Programming: Make Illegal States ImpossibleStop sprinkling if-guards and start encoding your domain’s rules directly in the types. Why “Defensive Programming” Is a Leaky Shield When you wrap every public method in if-then checks, you’re treating symptoms, not the disease. Defensive guards: R...Apr 23, 2025 · 5 min readcodecraftspro.hashnode.dev
What to Open, What to Close: A Pragmatic Guide to Interface DesignThe playbook for building software seams that bend with change, not break. Quick take: Every architectural regret starts as a small “harmless” interface. Four posts, twenty patterns, and dozens of code snippets show you how to choose the seam that s...Apr 21, 2025 · 2 min readcodecraftspro.hashnode.dev
Stop the Cascade: How to Design Interfaces That Survive ChangeThe Expression Problem: A Design Dilemma Most bugs appear when a change ripples through code you thought was finished. The cure is knowing what to keep closed and what to leave open*.* 🕰 A 60‑Second War Story Six months after launch, FinFast had t...Apr 21, 2025 · 3 min readcodecraftspro.hashnode.dev
Evolving in Two Dimensions: Interface Strategies for Real‑World Software(Expression Problem, Part 2)Patterns that survive both behaviour and variant volatility Part 1 showed how closed vs. open interfaces trade off variant‑vs‑behaviour extension. Part 2 arm‑you for messier reality, where both axes mutate at once. Expect visitors, decorators, regis...Apr 21, 2025 · 4 min readcodecraftspro.hashnode.dev
Stop Confusing Layers of Abstraction with Separation of ConcernsDevelopers often treat “abstraction layers” and “separation of concerns” as interchangeable terms. But in software design, they represent fundamentally different concepts — each with its own design goal, trade-offs, and failure modes. This post break...Apr 18, 2025 · 3 min readcodecraftspro.hashnode.dev