Hard-and-fast, black-and-white rules for getting started with Object-Oriented Programming
- No object should have more than three public methods
- Objects should not have getters or setters
- Everything else must be private
- If three private methods are doing something similar, then maybe those are the public methods of another class
- Never inherit
- Always compose
- Changeability is the most important thing
- A "good" variable name is a name that describes unambiguously what the variable contains, without describing the implementation
- If you don’t use good variable names, I will look for you. I will find you. And I will kill you.1
1
This is a reference to the movie "Taken".