I am looking for an essay critical of OOP on clojuredocs.org

I once read an essay on https://clojuredocs.org. Now I’d like to find it again, but I cannot find it. The essay made the point, which I think Rich Hickey original made, that object oriented programming introduces a problem of non-reusable code because every object, with its methods, is basically its own special little language.

Does anyone know of an essay on https://clojuredocs.org that repeats the standard criticism that the Clojure community has of OOP?

1 Like

Perhaps not what you’re thinking of/searching for, but your post reminded me of this one, which I like: Stevey's Blog Rants: Execution in the Kingdom of Nouns

I’m not sure that such essays would ever have been on clojuredocs.orgclojure-doc.org tends to have more “essay”-style pieces but I don’t believe it has ever hosted an essay on this topic. There’s this piece about state and identity on clojure.org (and maybe other parts of the rationale section will help): Clojure - Values and Change: Clojure’s approach to Identity and State

Some of what you might be thinking of is covered in Rich’s “Are we there, yet?” talk (again, mostly state and identity, but also time): talk-transcripts/Hickey_Rich/AreWeThereYet.md at master · matthiasn/talk-transcripts (github.com)

Several of Rich’s talks cover the issue of reusability and why user-defined types impede that (usually in the context of OOP), but it’s often more of an aside when he’s talking about generic code and abstractions, or the reusability of small, focused libraries.

Thank you for that. I used the wrong word when I said “essay.” It was an article that was instructional, but it included a paragraph or two that (at a minimum) repeated points that Rich Hickey had made about every object in object oriented programming having it’s own methods, and therefore being a mini-language unto itself. I think the contrast was to a more functional approach of generic data structures and a large number of functions that can do useful things with those generic data structures.

Thank you, I’ve read that before, but it is fun to read it again.

1 Like

Sounds like Clojure - Rationale OO is overrated, which summarizes Rich’s points and specifically quotes Perlis: “It is better to have 100 functions operate on one data structure than to have 10 functions operate on 10 data structures.”?

This sounds like the HttpServletRequest bit from Clojure Made Simple (transcript).

So one of the other things I think we suffer from in object orientation is death by specificity. All the time, we have a new thing, we have a new idea, a new piece of data. Boom! We have a new class. Get this, get that, get whatever.

I do not care if they are value types, whatever. It is just a glorified map, except you cannot even use it as a map in Java. There is no generic way to manipulate something that says: get this, get that, get that. So new type, new language, it has got its own little vocabulary.

So you are going to have more code. You are going to have much less reuse. You are going to have more coupling. Because essentially what is happening is every object has its own little language: my class, my interface, my own language. This is my biggest pet peeve. I wanted to get away from this. When we saw it writing get this, get that, there is no purpose to this. This is just life-sucking.

The paper you’re looking for is on the so-called “expression problem”, and is no longer available from the original site. Last time I checked, a year+ ago, it was still available on an internet archive site, but I don’t have the link any more and you’ll have to dig for it. I suggest googling for clojure and “expression problem”. It might have been authored by Stuart Sierra, I don’t remember.

It isn’t necessarily a repudiation of OO, there’s nothing wrong with OO (IMO), it’s a tool just like FP, each with pros and cons. What it describes is the problem of being able to extend behaviors without access to the original source code (a TL;DR description that probably isn’t correct, but it’ll have to do for my reply and/or limited memory of the paper).

1 Like

Solving the Expression Problem with Clojure 1.2 ?

That’s the one I was thinking of, thanks.