4 ms·
Encapsulation is extremely important and pairs with single responsibility, but that’s completely orthogonal to OOP. Once you are solidly in the composition cam
by hajile 3y ago
Encapsulation is extremely important and pairs with single responsibility, but that’s completely orthogonal to OOP.
Once you are solidly in the composition camp, functions are immediately superior. They tend to be naturally single purpose and have mathematical rules that make them easy to compose.
Most function-heavy languages also adopted modules which provide a better, less-leaky abstraction too and that’s without getting into all the other advantages in the type system or better syntactic ergonomics from dropping all the OOP baggage.