3 ms·
Java doesn't have particularly good compile-time type checking. It's mostly there for performance rather than safety guarantees. While Clojure is a dynamic lan
by weavejester 12y ago
Java doesn't have particularly good compile-time type checking. It's mostly there for performance rather than safety guarantees.
While Clojure is a dynamic language, it actually does have optional type checking, courtesy of the core.typed library. This isn't perfect, but it is considerably more sophisticated than Java's inbuilt type system.
Even without static type checking, I'd argue that Clojure is the safer language by default, since it mostly avoids mutability.
- HillOBeans 12y agoThis. The immutable nature of Clojure is what, IMHO, makes it such a better choice than Java for me. I frequently see discussions/debates around type safety on HN, but in my experience, it has been the mutable nature of Java systems that has created more bugs than anything else. Clojure being immutable by default has drastically reduced the pain caused by these bugs. Clojure's collections, FP style, and meta-programming (via macros) all make it a great choice for me, but I think being immutable by default is the biggest thing.