Hacker News new | ask | show | jobs
by epgui 695 days ago
Clojure is probably the most beautiful language I've ever worked with. Nothing is perfect, but Clojure is very simple and elegant.
2 comments

Only downside is I don't know Java, so some things that should be obvious are opaque to me.
You really don’t need to know any java. I don’t know java either.

Even if you’re doing java interop, it’s quite easy to figure it out.

Last time I looked about file IO it involves calling out to some Java class that I had no clue about as I don't use Java. All the doc of the time just assumed you should be able to figure this all out.

Edit: it's been like 5 years

The docs are better now (eg https://clojure-doc.org/articles/cookbooks/files_and_directo... ) but you still need to follow a Javadoc link every now and then for the full story.

Alternatively you can use a library such as https://github.com/babashka/fs .

I agree with the GP that you don't need to know any Java.

This was my experience too, at about the same time. I should really dig back into it at some point.
Java frolicks in opaqueness.
What makes Clojure a non-starter for me is that it runs on the JVM.
Could you expand why? It's not immediately obvious why would that be, my understanding is that the general consensus around here is that the JVM is a superb piece of tech with a bad rap due to java the language.
Slow startup, huge memory consumption, design that inherently favors class-based languages like Java, the frequent need to use Java libraries.
> Slow startup

This makes the jvm a bit less suitable for programmes with short lifetimes (like lambdas), depending on how sensitive startup times are in context... But is mostly irrelevant in long-lived applications like services.

> design that inherently favors class-based languages like Java

Clojure abstracts over this so well that it's really a non-issue for a wide array of use cases / applications. When programming in Clojure, you really don't have to think about objects and classes at all, unless you really insist on doing so.

> frequent need to use Java libraries

This would be going against the grain: you will have a much better time by staying within native Clojure. I've worked on commercial/production applications that barely had any java interop, and whatever java interop there was was rarely ever involved in day to day work.

---

Disclaimer: I also am not a huge fan of the JVM and I really dislike the Java world generally, but it never stood in the way of me getting stuff done with Clojure.