3 ms·
I don't think I can agree. OO feels like a tax, where payment is more coupling and layers of indirection in the codebase (and this is the happy case with good
by Hermitian909 4y ago
I don't think I can agree.
OO feels like a tax, where payment is more coupling and layers of indirection in the codebase (and this is the happy case with good OO practices) but no benefits out the other side.
Stepping back, an important set of question to ask when introducing any abstraction into a codebase is "What does it get me? What does it cost? Is what it gets me worth the costs?". OO says implicitly says "objects are always worth the cost" and I just haven't found that to be true.
(keeping the metaphor going, this is obviously not so great a tax it's going to kill companies, hugely successful companies the world over pay it with out issue, but it irks me!)
- zabzonk 4y ago>more coupling and layers of indirection actually, OO claims less coupling. as to layers of indirection, i don't think it claims anything. > OO says implicitly says "objects are always worth the cost" don't know where you get this "always" from - objects are sometimes, maybe even often worth "the cost" (which is small), but not "always"
- stonemetal12 4y agoIn Java "public final class Math extends Object". So yeah, some parts of OO land went "always". I think that is way to far. As far as I am concerned Objects have their uses. Files in Haskell and the sequence abstraction in Clojure look like objects in everything but name to me.
- zabzonk 4y agoof course it is too far, which is why other languages don't do it, though they use objects elsewhere
- nh23423fefe 4y agoBut thats irrelevant. You can't instantiate that class so what does it matter. How should it be different?
- rqtwteye 4y ago“ OO says implicitly says "objects are always worth the cost" and I just haven't found that to be true.” It doesn’t always say that. That’s an interpretation only some ideologues have. Any paradigm will fall apart when overused. Software is still an art where you have to have taste to choose between several options.
- Nevermark 4y agoLanguages that shoehorn everything into objects, especially heavy weight objects (where it takes a class to create a simple function, a single variable, or single constant, ...) are not just ideologies. They are widely used tools, and actively helpful or coercive in their enforcement of a particular view coding.
- nh23423fefe 4y agoI'm not sure how this can be a criticism of OO. classes are tuples with named members, methods are procedures with an implicit param. There is no OO tax. the benefits are obvious. clarity in data dependence, encapsulation, code reuse. I dont see how OO causes coupling or indirection.
- slackdog 4y ago> methods are procedures with an implicit param. Eh, not really? In single-dispatch, one of the arguments is often syntactically distinct from the others and is treated specially, but I wouldn't say that it's implicit. And with multiple dispatch object systems, all arguments are treated the same.