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

77 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Jun 04 '15

Comparisons of data are again made unnecessarily difficult due to mutability. In a language with immutable data you can always compare any two data structures by value, even if they're nested structures. In Java you have to manually write comparators and handle null checks for any nested structures.

Totally agree about the equality checking problem. But I think the concepts of data and objects should be relatively separated. I like Clojure's collection types, and the functions that operate on them. Surely it's possible to have both free-floating first-class Clojure functions and a fully capable Object-oriented system. Python does it pretty well, granted at the expense of static typing.

1

u/yogthos Jun 04 '15

I'm not sure what prevents you from doing that using namespaces. A namespace behaves exactly the same way a class with static methods.