Broken Windows Theory
ELI5 — The Vibe Check
The broken windows theory in code says that once one piece of bad code exists, more bad code follows. If there's already a hacky workaround in the file, the next developer thinks 'well, it's already messy' and adds another hack. One TODO comment becomes fifty. One skipped test becomes no tests. Entropy wins if you don't fix the first broken window.
Real Talk
Applied to software from criminology, the broken windows theory suggests that visible signs of code neglect (dead code, skipped tests, ignored warnings) encourage further neglect. Teams that maintain high code quality standards find it easier to keep them, while codebases with existing problems accumulate new problems faster. It's the theoretical basis for 'boy scout rule' (leave code cleaner than you found it).
When You'll Hear This
"Fix that lint warning now — broken windows theory." / "The codebase has so many broken windows that nobody bothers writing tests anymore."
Related Terms
Clean Architecture
Clean Architecture is like an onion with strict rules: the inner layers (your core business logic) have absolutely no idea the outer layers (databases, API...
Code Review
A code review is when another developer reads your code before it gets merged, looking for bugs, bad practices, or anything confusing.
Code Smell
Code Smell is when code isn't technically broken but something feels off — like a 500-line function, a class named 'Manager' that does everything, or a com...
Refactor
Refactoring is cleaning and reorganizing your code without changing what it does — like tidying your room without throwing anything away.
Technical Debt
Technical debt is the coding equivalent of putting things on a credit card.