The Open Closed Principle

Clean Code In The Browser, Episode 3

By Chris Powers

85 minSep 2017

It's 4:55 pm on a Friday afternoon. You're packing up your things to head out for the weekend when suddenly the phone rings. It's the boss. Don't worry, they only need "one little change"... shouldn't be too bad, right?

Join Chris Powers in this fun episode as he desperately tries to get home on time while discovering the benefits (and challenges) of using the "O" in SOLID: the Open Closed Principle. This episode specifically hones in on applying the technique to browser code in JavaScript. Through a series of poor implementations and subsequent refactorings, we learn how the Open Closed Principle helps reduce code churn and improve maintainability by making it open to extension but closed to modification.

Along the way, Chris explores the topic of production incidents and how leading practices should (and should not) be used while systems are "on fire". He also discusses the importance of team collaboration, the hidden danger of Lone Wolves, and the critical nature of building shared understanding and expectations within software development teams.