Explores the historical origins and context of the "favor composition over inheritance" principle from the Gang of Four's Design Patterns book. Examines the three-page discussion that led to this aphorism, including the white-box versus black-box reuse distinction, language-specific considerations in Smalltalk and Java, and the compile-time versus runtime trade-offs. References Barbara Liskov's earlier work on subtypes and polymorphism, highlighting that composition and inheritance aren't the only options—first-class procedures offer a third alternative that the simplified aphorism overlooks.

5m read timeFrom sicpers.info
Post cover image
6 Comments

Sort: