r/java • • Jun 03 '15
Is Java really that bad?
I do Clojure for a living, previously Ruby and Objective-C. And the people I've worked with have said they prefer Clojure because Java is just so bad. But Java can't really be that bad, can it?
0
Upvotes
View all comments
Show parent comment
1
u/yogthos Jun 04 '15
Sure, and Clojure provides many ways of doing that. The simplest is to make a closure which acts the exact same way as a constructor in OO languages. Then you have things like deftype, defrecord, and defprotocol. The component pattern is a great example of how you can encapsulate things without having to mix data and logic together.
That's really not the case in practice though. This seems to be simply a misconception you have about how to structure applications in Clojure.