99 Bottles of OOP — 2nd Edition by Sandi Metz
A practical guide to writing cost-effective, maintainable, and pleasing object-oriented code. Available in Python, JavaScript, PHP, and Ruby editions. Also comes in "beer" and "milk" beverage variants. Digital-only formats: epub, kepub, mobi, pdf. Current version: 2.2.2 (as of December 1, 2024), approximately 105,000 words.
What It Teaches
- Recognizing when code is "good enough"
- Getting value from Test-Driven Development (TDD)
- Proper refactoring (contrasted with "rehacktoring")
- Locating concepts buried in code
- Naming for deeper meaning
- The "Flocking Rules" for safe code alteration
- Open/Closed Principle for simplifying additions
- Liskov Substitution Principle to avoid conditionals
- Reducing Code Smells for targeted improvements
- Polymorphism for changeability
- Factories for manufacturing role-playing objects
- Loosening coupling to hedge against uncertainty
- Developing a "programming aesthetic"
Methodology
The book contains an extended refactoring with rationale behind every change. It's a "hands-on workbook rather than a list of theoretical ideas." It teaches how OO design principles guide not just final code arrangement but "each decision about what line of code to write next."
Key Quotes
"It explains the process of writing good code, and teaches you to achieve beautifully programmed ends by way of extremely practical means."
"hands-on workbook rather than a list of theoretical ideas"
The Flocking Rules for safe code alteration — a structured approach to refactoring
Proper refactoring, contrasted with "rehacktoring"
Who It's For
Programmers of all experience levels, from "rank novice to grizzled veteran." Language-agnostic in philosophy, though examples come in four specific languages.
What's New in 2nd Edition
Contains 3 new chapters (about 50% longer than the 1st Edition). Separate language-specific editions. Purchase grants rights to download any or all of the 32 possible combinations (4 languages × 2 beverages × 4 formats).
Resources
- Errata submissions accepted via dedicated page
- FAQ available
- Postcard program for those who can't afford the book
- Return policy for dissatisfied purchasers
- Sample chapters available for JavaScript, PHP, Python, and Ruby
- Rated on Goodreads: https://www.goodreads.com/book/show/31183020-99-bottles-of-oop
- Mentioned in the Why Are Computers podcast