4 ms·
>> Maybe I'm just stupid, or have worked on some limited subset of applications. It seems to me that Graham answers this question in the preceeding paragraph:
by mamon 8y ago
>> Maybe I'm just stupid, or have worked on some limited subset of applications.
It seems to me that Graham answers this question in the preceeding paragraph:
>> I've done a lot of things (e.g. making hash tables full of closures) that would have required object-oriented techniques to do in wimpier languages, but I have never had to use CLOS.
He simply writes ad-hoc implementation of an object system, instead of using one provided with his favourite language. Seems like a bad case of NIH syndrome.
- pdimitar 8y ago> He simply writes ad-hoc implementation of an object system, instead of using one provided with his favourite language. Seems like a bad case of NIH syndrome. Could be. Or maybe he just accepts OOP as a necessary tool in a small percentage of cases and opts for the lesser of the two evils -- rolling his own mini-OOP system as opposed to accepting all the baggage that comes with a first-class OOP language (like side effects and bloated code). Remember the saying "when you code with an OOP language, you not only get the banana, but the gorilla and the whole jungle". I know I would defend OOP to my dying breath just a short 2-3 years ago. But when I started working with FP languages I discovered that OOP is vastly overrated. I am not as naive as to think that I will change your mind. Just offering another perspective.
- dasmoth 8y agoI don't think making a hash table of closures is necessarily equivalent to "object orientation". Sure, if you use a set of well-known keys to represent an interface, then it's headed that way. But the same structure can be used for other things, e.g. a table of opaque IDs to closures encapsulating a possible "next step" through a workflow in an interactive program. Indeed, I think the original news.arc did exactly that in many places (and contemporary Hacker News still does somewhat?). (My reading of the "wimpier languages" bit was that it was probably a dig at Java, where [prior to Java 8], you had to explicitly write an inner class to emulate a closure...)
- dreamcompiler 8y agoI've always disagreed with pg's contention that objects are the poor man's closures, at least w.r.t. Common Lisp. I write a lot of Common Lisp code and almost every one of my programs uses CLOS in some way (and many of my programs use closures too; they're complementary). I'd probably never use CLOS if it limited me to single inheritance or single dispatch or prohibited reclassification like most OO systems do, but it doesn't. CLOS is OO without the arbitrary restrictions.