concept OOP in category clojure

appears as: OOP
The Joy of Clojure, Second Edition

This is an excerpt from Manning's book The Joy of Clojure, Second Edition.

Imperative programming is the dominant programming paradigm today. The most unadulterated definition of an imperative programming language is one where a sequence of statements mutates program state. During the writing of this book (and likely for some time beyond), the preferred flavor of imperative programming is the object-oriented style. This fact isn’t inherently bad, because countless successful software projects have been built using object-oriented imperative programming techniques. But from the context of concurrent programming, the object-oriented imperative model is self-cannibalizing. By allowing (and even promoting) unrestrained mutation via variables, the imperative model doesn’t directly support concurrency. Instead, by allowing a maenadic[12] approach to mutation, there are no guarantees that any variable contains the expected value. Object-oriented programming takes this one step further by aggregating state in object internals. Although individual methods may be thread-safe through locking schemes, there’s no way to ensure a consistent object state across multiple method calls without expanding the scope of potentially complex locking scheme(s). Clojure instead focuses on functional programming, immutability, and the distinction between state, time, and identity. But OOP isn’t a lost cause. In fact, many aspects are conducive to powerful programming practice.

1.4.3. Most of what OOP gives you, Clojure provides

It should be made clear that we’re not attempting to mark object-oriented programmers as pariahs. Instead, it’s important that we identify the shortcomings of OOP if we’re ever to improve our craft. In the next few subsections, we’ll touch on the powerful aspects of OOP and how they’re adopted and, in some cases, improved by Clojure. To start, we’ll discuss Clojure’s flavor of polymorphism, expressed via its protocol feature, an example of which is shown next.