The Broken Windows Theory in JavaScript: Why Small Issues Matter

How the Broken Windows Concept Can Help You Write Better JavaScript Code

Jose Granja
3 min readMar 28, 2023
Photo by Jake Noren on Unsplash

Imagine walking through a neighborhood with broken windows. What’s the first thing that comes to mind? You might think that the area is unsafe, neglected, or even abandoned. This same concept applies to software development, and it’s known as the “Broken Windows” theory.

The theory was introduced in the 1980s by criminologists James Q. Wilson and George L. Kelling. They argued that visible signs of disorder, such as broken windows, can lead to an increase in more serious crimes. In the world of software development, the Broken Windows theory has been adapted to refer to the negative impact of leaving small problems in code unaddressed.

The Pragmatic Programmer, a book by Andrew Hunt and David Thomas, popularized the Broken Windows concept in software development. The idea is that small issues, such as typos or unused code, can accumulate and eventually lead to bigger problems. The longer these issues remain unresolved, the harder it becomes to fix them. This can lead to a lack of discipline and pride in the code, which ultimately results in lower-quality software.

--

--

Jose Granja

Top Writer @Medium | 1M+ Views | Lead FE @Lingoda | I write weekly about web-development topics 📰 Support me at https://dioxmio.medium.com/membership 🙇