Object-oriented programming is one of the most misunderstood topics in the computer world. One reason for this is that there isn’t a good learning resource that is both high-quality and freely available to everyone. I started writing this book because it pains me to see how many important and fundamental concepts in OOP are taught incorrectly. My goal is to clear away the misinformation that surrounds OOP. Over the years, many of its key ideas have been explained poorly, or worse, completely misunderstood, which has made learning OOP harder than it should be. Through this book, I want to give you a clear, practical path to understanding object-oriented programming the way it was meant to be understood.
This book is about object-oriented programming. I’ve called it Understanding Object-Oriented Programming for a reason; the understanding part really matters. Many programmers pick up just enough OOP to get their work done and then stop there. They don’t take the time to fully explore its core ideas, but that has a cost, without real understanding, programming often becomes harder in the long run. Limited knowledge leads to messy, rigid code that’s difficult to maintain and frustrating to extend.
My other goal is to teach OOP from the ground up. I want you to feel as though you are discovering OOP yourself, step by step. I believe OOP should be taught this way, because true understanding comes when you see not just how it works but also why. With this foundation, you’ll be able to make better decisions about which techniques to apply in different situations. It also makes advanced topics, like design patterns, far easier to grasp. Even if you are already a professional programmer, you’ll find parts of this book that challenge your assumptions and deepen your understanding.
- Preface
- Chapter 1: Objects: United Data and Operations
- Chapter 2: Class: A Factory for Objects
- Chapter 3: Encapsulation: Hidden from the Outside World
- Chapter 4: Abstraction: A Simplified View
- Chapter 5: Inheritance: Code Reusability
- Chapter 6: Polymorphism: Reusing Interfaces
- Chapter 7: Composition: Objects Made of Objects
Contributions are welcome! If you’d like to improve code snippets, clarify explanations, or enhance the content in any way, please submit a pull request (PR).
If you’re unsure about a change or think a word or phrase might be confusing, open an issue to discuss it before submitting a PR.
Before opening a new issue or PR, please search through existing issues (both open and closed) to see if your question, concern, or suggestion has already been addressed.
