Hacker News new | ask | show | jobs
by briancarper 5856 days ago
On a low level, Clojure exposes the underlying JVM, so you can instantiate and bang on Java objects all you want. It's "hybrid" in that sense, and always has been. That isn't changing. But dipping into Java in Clojure is used mostly for interop with Java libraries or to get better performance for critical sections of code.

On a higher level, in Clojure itself, there's not much OO going on (depending how you define OO), and that's not changing much either. In the new defrecords: 1) Everything is immutable, 2) There's no encapsulation of methods inside objects, 3) There's no inheritance of method implementations from "parent classes", 4) There's no data-hiding, and all fields are public. Uncontrolled thread-unsafe mutation of "objects" is still not kosher. Defrecords are kind-of-OO in the sense that there are named types that you can instantiate, the resulting things have named fields, and there's some polymorphism going on when you use protocols. But it's not really very OO in my opinion.

http://clojure.org/datatypes and http://clojure.org/protocols are the official docs, if you want to know exactly what you're getting.

"Object oriented" and "functional" are so loosely-defined that it's almost best to avoid using the terms entirely, in my opinion. See http://clojure-log.n01se.net/date/2010-04-21.html for some of Rich Hickey's opinions on how OO Clojure is nowadays. Rich uses the term "abstraction-oriented" to describe Clojure.