3 ms·
It's not like one paradigm is perfect for everything. But there's one thing that the author wrote that stood out for me: writing a "utils" class for stuff he do
by abalone 13y ago
It's not like one paradigm is perfect for everything. But there's one thing that the author wrote that stood out for me: writing a "utils" class for stuff he doesn't "know where it really belongs."
That's one of the benefits of OOP: it forces you to think harder about where things belong, and this really helps as codebases grow. A "utils" class is often a sign that things could be better organized.
- sagarm 13y agoI couldn't disagree more that thinking harder about where things belong is a benefit of OOP: it's an entirely unnecessary tax caused by the requirement to wrap every symbol in a class. Another aspect of this is unnecessary effort expended on deciding if A.operateson(B) or B.operateson(A). Sometimes, you want to Operate(A, B). If your language doesn't allow that, you end up with operator.Operate(A, B). Classes are not always the best organizational tool.