6 ms·
I loved this: > When we drop down to the algorithm level, I think OO can seriously thwart reuse. In particular, the use of objects to represent simple informat
by DavidMcLaughlin 15y ago
I loved this:
> When we drop down to the algorithm level, I think OO can seriously thwart reuse. In particular, the use of objects to represent simple informational data is almost criminal in its generation of per-piece-of-information micro-languages, i.e. the class methods, versus far more powerful, declarative, and generic methods like relational algebra. Inventing a class with its own interface to hold a piece of information is like inventing a new language to write every short story. This is anti-reuse, and, I think, results in an explosion of code in typical OO applications.
- hvs 15y agoI think he has a good point, and as someone who really likes functional languages, I agree with him, but I think there really needs to be a better explanation of functional "patterns" and how to structure large functional programs before it will catch on more. Also, it's easy to say, "object-oriented programming is bad for reuse," but that's not all OO is for (i.e. encapsulation, etc.).
- kenjackson 15y agoI'd have to go back through the literature, but reuse was not something I heard talked about much at all when I first seriously started doing OO in the 90s. With that said, reuse with OO today is not in a horrible state, no pun intended. Things can certainly be easier, but I think design is the bigger issue. And the problems I see suffer in functional designs as well as OO designs.
- jamesbritt 15y agoI'd have to go back through the literature, but reuse was not something I heard talked about much at all when I first seriously started doing OO in the 90s. Maybe it was an '80s thing, but I recall "reusable software components" being touted as the industry savior. OO was all about reuse then.
- o1iver 15y agoSee Fred Brooks's "No Silver Bullet". If I remember correctly that was one of his hopes for OO...
- DavidMcLaughlin 15y agoEncapsulation is also addressed in the article. I really liked his response to that too, it was like a more succinct version of the Steve Yegge Wikileaks/Java private methods blog post[1] that did the rounds a few months back. [1] - http://steve-yegge.blogspot.com/2010/07/wikileaks-to-leak-5000-open-source-java.html http://steve-yegge.blogspot.com/2010/07/wikileaks-to-leak-50...
- rads 15y ago> I think he has a good point, and as someone who really likes functional languages, I agree with him, but I think there really needs to be a better explanation of functional "patterns" and how to structure large functional programs before it will catch on more. Are there any good existing resources for learning these things?
- swannodette 15y agoIt's really hard to beat Hickey's Clojure Bookshelf, http://www.amazon.com/Clojure-Bookshelf/lm/R3LG3ZBZS4GCTH http://www.amazon.com/Clojure-Bookshelf/lm/R3LG3ZBZS4GCTH. I've found the Standard ML books to be particularly illuminating as far as structuring functional code.
- Luyt 15y agoApparently he reads those books while lying in a 'Presidential Cotton Rope Hammock' [1], which is at the bottom of his Bookshelf list ;-) [1] http://www.amazon.com/Presidential-Cotton-Rope-Hammock-Size/dp/B002DEO458 http://www.amazon.com/Presidential-Cotton-Rope-Hammock-Size/...
- icey 15y agoIt's a reference to this talk: http://blip.tv/clojure/hammock-driven-development-4475586 http://blip.tv/clojure/hammock-driven-development-4475586
- kenjackson 15y agoWhat is simple informational data? I've never heard that term before, and its not obvious what he's referring to.
- DavidMcLaughlin 15y agoI took it to mean data objects.
- fogus 15y agoHe expands on that when he talks about an "associative model" of information.
- pwpwp 15y agoHis argument against using classes/objects is that objects (in mainstream PLs) can't be accessed in a dictionary-like fashion. But switching to dictionaries wholesale for this reason seems to throw out the baby with the bathwater. The loss of abstraction is real, and could be worked around trivially by making every object respond to a dictionary protocol. This would give you the best of both worlds.
- kenjackson 15y agoDon't most mainstream languages now give you this? I think Javascript, C#, Ruby, Python give you this. C++ and Java don't. And as you say, you do lose a fair bit giving this away.
- swannodette 15y agoNo all those languages suffer (except JS) from the fact they don't give you uniform access. Consider the different forms of access for dict types, array types, object types in said languages.
- kenjackson 15y agoI have to admit that this distinction seems really minor. But maybe I'm missing something here. I'd love to see an example if anyone has one.