Read in Russian.
Book about SOLID principles and object-oriented software design. It's written in Russian, if you want to help with translation, please, let me know: bespoyasov@me.com.
Programming is difficult.
Good code adequately reflects the system it describes, it is robust to changes in that system. Bad code is confusing, flimsy, and incomprehensible—it slows down development.
Code becomes bad when it no longer corresponds to reality, the business requirements. Business rules are the territory, the code is a map of this territory. The more accurate the map, the easier it is to cope with changes in requirements and even to anticipate them.
In this book, we want to show by example how the principles of object-oriented programming can help design a sustainable system.
We're going to look at 5 SOLID principles, namely:
- Single Responsibility Principle
- Open-Closed Principle
- Liskov Substitution Principle
- Interface Segregation Principle
- Dependency Inversion Principle
Each of these is only a recommendation; they all have scope and boundaries. But to see those boundaries, you need to understand the benefits and costs of each of them. Many principles will seem to you to be too abstract, too vague, or too far-fetched. Treat such principles like the zen of Python—keep them in mind, but check how useful they are in a particular situation.
In this book we offer another of an infinite number of interpretations of these principles, spelling out in passing the benefits and limitations of each. Knowing the benefits and limitations, you can assess how much a particular principle helps you solve the problem you're facing.
This book was written by:
- Alex Bespoyasov, developer at 0+X, co-author of Tzlvt, former teacher at Netology;
- Artem Samofalov, lead frontend developer at Social Discovery Ventures, former teacher at LoftSchool.
...And project contributors ❤️
The text and illustrations of the book are distributed under the CC BY-NC-SA 4.0 license. You can modify and use them in non-commercial projects as long as you keep the license and mention the authors.
The source code of the project is distributed under the MIT license.