Other important principles
I found two other principles to talk about briefly before going further:
- Separation of concerns
- Don't repeat yourself (DRY)
Of course, after reading the SOLID principles, you may find these more basic, but they are still complementary to what we just learned.
Note
There are many other principles, some that you may already know, some that you will most likely learn about later, but at some point, I have to choose the subjects or face writing an encyclopedia-sized book.
Separation of concerns
The idea is to separate your software into logical blocks, where each block is a concern; this can go from factoring a program into modules to applying the SRP to some subsystems. That can be applied to any programming paradigm. How to encapsulate a specific concern depends on the paradigm and the concern's level. The higher the level, the broader the solution; the lower the level, the more granular it becomes.
For example...