The market is flooded with books about object-oriented programming, especially those written for junior developers. This book may appear similar at first glance. It starts from the basics and explains what an object is, how objects communicate through methods, and how programs are structured around these interactions. In that sense, it follows the traditional path of introducing OOP to beginners.
However, the perspective presented here differs from that of most introductory texts. The language used in the examples is JavaScript, but the conceptual model of object-oriented design is intentionally stricter and more disciplined than what is typically taught. The principles described in this book focus on clear object boundaries, well-defined responsibilities, and predictable behavior. If you internalize them, they will remain useful regardless of the programming language you use later in your career.
The central exercise of the book is the step-by-step development of a simple game inspired by Space Invaders. Starting with the first .js file, the program gradually evolves into a complete working game. By the end of the book, the full source code is available and functional, with the project hosted on GitHub.
Along the way, you will encounter the core ideas of object-oriented programming: encapsulation, polymorphism, inheritance, dynamic dispatch, and decoration. The book also introduces several design patterns and explains when they are useful. In addition, it demonstrates practical engineering practices such as writing unit tests, automating builds, and using static analysis tools.
The goal is not only to help you build a small game, but to develop a clear and durable understanding of object-oriented programming. With that foundation, you will be able to write cleaner, more maintainable software in any language you choose.