Re:Ask HN: Where did you first come across functional progra...
by revskill on Thursday June 01, 2023 @06:51AM
(#36149506)
OOP programmer lives inside the GoF design pattern and the result is AbstractSingletonFactoryBeanProxyAdapter class you love !
Nowdays, my programm is mostly the composition of some functions. Want inheritance and polymorphism ? Just use object composition and multi dispatch functions.
The way to go forward is abandon any of `class` keyword.
Protected, public, private is a lie and also a trap. It didn't prove anything.
Your encapsulation rule is inside your interfaces, not inside your class keyword.
Now you can say: But OOP served me well, i can get shit done fast !
Absolutely, any tools can serve you enough. The issue is, once you use the bad tools, you get into a rabbit hole to slow down everything else eventually.
Nowdays, my programm is mostly the composition of some functions. Want inheritance and polymorphism ? Just use object composition and multi dispatch functions.
The way to go forward is abandon any of `class` keyword.
Protected, public, private is a lie and also a trap. It didn't prove anything.
Your encapsulation rule is inside your interfaces, not inside your class keyword.
Now you can say: But OOP served me well, i can get shit done fast !
Absolutely, any tools can serve you enough. The issue is, once you use the bad tools, you get into a rabbit hole to slow down everything else eventually.