Escaping the Code Maze
summary
Claims that applying the Closed-by-Default Principle shrinks a class’s implicit assumptions from about ten down to two by using language features (final, typed and readonly properties, nullable and return types) and by adding declare(strict_types). The build uses automated refactors and checks with Rector, PHP CS Fixer and PHPStan, plus a CI workflow in the companion repo, and it succeeds: files become type safe, more strictness enables more automation and the loop tightens until most dead‑end paths are sealed.
AI-written summary · about
chapters (19)
- 0:00Codebase maze analogy
- 1:05Closed by default principle
- 3:13PHP 5 features reduce assumptions
- 5:23PHP 7 stricter typing
- 7:51PHP 7.1/7.4 tighter control
- 9:15PHP 8 constructor promotion
- 10:39PHP 8.2 readonly classes
- 11:42PHP evolution reduces load
- 12:23Static analysis automation
- 13:48Rector automated refactoring
- 15:12Finalizing classes with rector
- 16:37Enforcing access modifiers
- 18:47PHPStan strict type checking
- 20:31Static analysis feedback loop
- 22:01Open closed principle
- 23:47Intentional code extension
- 25:35Navigable codebases
- 27:21Custom rules and AI guardrails
- 28:27Summary
related talks
51mPreventing Security Bugs through Software Design
58mIntentional Code - Minimalism in a World of Dogmatic Design
54mCommunicating, Sharing and Maintaining Architectural Decisions in Development Teams
38mSecure Coding: Back to basics
40mBarely Enough Design
41mUsing Boundary-Driven Development to beat code complexity
56mPrinciples of Elegance
50mIntentional Code - Minimalism in a World of Dogmatic Design
