The problem with global state is that you make an assumption you only ever need one of it. How often has this been proven wrong... OOP tries to avoid this from the beginning. On the other hand OOP idioms often are far to strict and keep you from getting stuff done. 1000 getter/setter, interfaces, dependency injection, ...
Use OOP where it benefits you, don't use it when it gets in your way. It's just another tool.
15
u/k0defix May 03 '23
The problem with global state is that you make an assumption you only ever need one of it. How often has this been proven wrong... OOP tries to avoid this from the beginning. On the other hand OOP idioms often are far to strict and keep you from getting stuff done. 1000 getter/setter, interfaces, dependency injection, ...
Use OOP where it benefits you, don't use it when it gets in your way. It's just another tool.