99 Bottles of OOP, A Practical Guide to Object-Oriented Design, Ruby Edition
- Length: 182 pages
- Edition: 1.01
- Language: English
- Publisher: Potato Canyon Software
- Publication Date: 2017-09-03
“Everybody complains about the weather but nobody does anything about it.” Likewise, everyone has an opinion about what good code looks like, but those opinions don’t help you create it. This book fills that gap. It explains the process of writing good code, and teaches you to achieve beautifully programmed ends by way of extremely practical means.
What It’s About
99 Bottles of OOP is a practical guide to writing cost-effective, maintainable, and pleasing object-oriented code.
It explores:
- Recognizing when code is “good enough”
- Getting the best value from Test-Driven Development (TDD)
- Doing proper refactoring, not random “rehacktoring”
- Locating concepts buried in code
- Finding names that convey deeper meaning
- Safely altering code by following the “Flocking Rules”
- Simplifying new additions with the Open/Closed Principle
- Avoiding conditionals by obeying the Liskov Substitution Principle
- Making targeted improvements by reducing Code Smells
- Improving changeability with polymorphism
- Manufacturing role-playing objects using Factories
What Makes It Unique?
We are practical people. We love beautiful code but we’re committed to getting things done. 99 Bottles of OOP enables both of these desires. It teaches a practical technique for getting things done that leads, naturally and inevitably, to beautiful code.
This book contains an extended refactoring, and it details the rationale behind every change. It is a hands-on workbook rather than a list of theoretical ideas. It explains how to use the principles of object-oriented design to guide, not just the final arrangement of code, but each decision about what line of code to write next.
It teaches the theory of what good OO looks like, but even better, it supplies step-by-step guidance about how to achieve it.
Who Should Read It?
The lessons work for programmers with a broad range of experience, from rank novice to grizzled veteran. The code examples are written in Ruby, but this book is not about Ruby–it’s about object-oriented programming and design. Regardless of your background, applying these techniques will make your code easier to understand, simpler to change, and more satisfying to contemplate.
What’s In The Current Version?
As of September 3, 2017, the current release is version 1.0.1. This is the complete book, and is nearly 70,000 words long (longer than most novels, about average for a mystery, and, sadly, shorter than most thrillers).
Table of Contents
Chapter 1. Rediscovering Simplicity
Chapter 2. Test Driving Shameless Green
Chapter 3. Unearthing Concepts
Chapter 4. Practicing Horizontal Refactoring
Chapter 5. Separating Responsibilities
Chapter 6. Achieving Openness
Appendix A: Prerequisites
Appendix B: Initial Exercise
Colophon Dedication Preface What This Book Is About Who Should Read This Book Before You Read This Book How To Read This Book Code Examples Errata About the Authors Introduction 1. Rediscovering Simplicity 1.1. Simplifying Code 1.1.1. Incomprehensibly Concise 1.1.2. Speculatively General 1.1.3. Concretely Abstract 1.1.4. Shameless Green 1.2. Judging Code 1.2.1. Evaluating Code Based on Opinion 1.2.2. Evaluating Code Based on Facts 1.2.3. Comparing Solutions 1.3. Summary 2. Test Driving Shameless Green 2.1. Understanding Testing 2.2. Writing the First Test 2.3. Removing Duplication 2.4. Understanding Transformations 2.5. Tolerating Duplication 2.6. Hewing to the Plan 2.7. Exposing Responsibilities 2.8. Choosing Names 2.9. Revealing Intentions 2.10. Writing Cost-Effective Tests 2.11. Avoiding the Echo-Chamber 2.12. Considering Options 2.13. Summary 3. Unearthing Concepts 3.1. Listening to Change 3.2. Starting With the Open/Closed Principle 3.3. Recognizing Code Smells 3.4. Identifying the Best Point of Attack 3.5. Refactoring Systematically 3.6. Following the Flocking Rules 3.7. Converging on Abstractions 3.7.1. Focusing on Difference 3.7.2. Simplifying Hard Problems 3.7.3. Naming Concepts 3.7.4. Making Methodical Transformations 3.7.5. Refactoring Gradually 3.8. Summary 4. Practicing Horizontal Refactoring 4.1. Replacing Difference With Sameness 4.2. Equivocating About Names 4.3. Deriving Names From Responsibilities 4.4. Choosing Meaningful Defaults 4.5. Seeking Stable Landing Points 4.6. Obeying the Liskov Substitution Principle 4.7. Taking Bigger Steps 4.8. Discovering Deeper Abstractions 4.9. Depending on Abstractions 4.10. Summary 5. Separating Responsibilities 5.1. Selecting the Target Code Smell 5.1.1. Identifying Patterns in Code 5.1.2. Spotting Common Qualities 5.1.3. Enumerating Flocked Method Commonalities 5.1.4. Insisting Upon Messages 5.2. Extracting Classes 5.2.1. Modeling Abstractions 5.2.2. Naming Classes 5.2.3. Extracting BottleNumber 5.2.4. Removing Arguments 5.2.5. Trusting the Process 5.3. Appreciating Immutability 5.4. Assuming Fast Enough 5.5. Creating BottleNumbers 5.6. Recognizing Liskov Violations 5.7. Summary 6. Achieving Openness 6.1. Consolidating Data Clumps 6.2. Making Sense of Conditionals 6.3. Replacing Conditionals with Polymorphism 6.3.1. Dismembering Conditionals 6.3.2. Manufacturing Objects 6.3.3. Prevailing with Polymorphism 6.3.4. Making Peace With Conditionals 6.4. Transitioning Between Types 6.5. Making the Easy Change 6.6. Defending the Domain 6.7. Prying Open the Factory 6.8. Summary Afterword Appendix A: Prerequisites Ruby Minitest Appendix B: Initial Exercise Getting the exercise Doing the exercise Test Suite References Acknowledgements
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.