Choosing an IDE/Editor for Clojure coding
I'm looking for an editor or an IDE for my Clojure coding and I found this thread:
Clojure editor/IDE recommendations on Mac OS X
However I have a couple of questions:
Which IDE offers the best Clojure environment (right now): IntelliJ, Eclipse or NetBeans?
What are the advantages of Aquamacs (I read Rick is using it) over the previous heavy-weight IDEs?
I have spent significant chunks of time (on a Mac) with:
- Textmate w/ Clojure bundle
- Netbeans Enclojure
- Eclipse CCW
- Emacs.app (not Aquamacs)
My opinions on those:
Textmate - was a great way to get started and is obviously a very functional text editing environment. At some point I wanted better REPL integration.
NetBeans - not wanting to learn Emacs, I switched to NetBeans. The NetBeans editor is ok. I found the integration with build tooling for things like Maven was rocky. The NetBeans remote repl is very very good.
Emacs - I eventually bit the bullet and learned Emacs. Editing with paredit is truly god-like. REPL integration is glorious as you'd expect. clojure-test-mode is very handy. But it's Emacs with all its pros and cons. If you're going to use Emacs on the mac, I'd recommend using Emacs.app, not Aquamacs. Aquamacs does not follow standard gnu emacs conventions and you'll find it harder to create a portable environment or use other people's extensions. Right now, I use Emacs for day-to-day editing and my normal work environment.
Eclipse - The Eclipse editor is coming along and the structural editing has some of the niceties of paredit (but not the truly essential slurp, barf, splice capability). The Eclipse repl is just a stock command-line repl and is pretty bad in comparison to NetBeans. However, the NetBeans remote repl has been broken out into an independent project and is coming very soon to Eclipse which will make Eclipse even more attractive. Maven integration is very good. I use Eclipse now when I want to see lots of files and projects at once, which I have a hard time doing in Emacs.
At the moment, my bet is that the Eclipse tooling will start to pull away from the others. But I'm still hoping for a Clojure-specific IDE to show up. :)
UPDATE Mar 10, 2014:
The world has changed a lot since I first wrote this. There are now at least 6 very good Clojure environments.
If you have not allegiance to a pre-existing editor and want an easy place to start, there are two great choices:
1) Nightcode - everything you basically need to write and run Clojure in a new editor written in Clojure itself. Really easy to set up and just get going.
2) Light Table - LT is written in ClojureScript but I'd say has more ambitious goals to change the way we write code, making it more interactive and our data more visible. Very active plugin scene.
If you are a Java programmer coming from the world of IDEs or feel like the support of a an IDE might be useful to you, then check out:
3) IntelliJ Cursive - this reboot of the IntelliJ Clojure environment is rapidly winning converts. Great set of tooling for Clojure and its getting even better rapidly.
4) Eclipse Counterclockwise - CCW has been in work for years and continues to file down the getting started and ease of use rough edges. If you're an Eclipse user already, you'll feel right at home.
If you are a keyboard hacker, both of these have excellent environments:
5) Emacs with CIDER - Emacs is more a way of life than an editor and for a long time was the only editor that could handle professional level needs for Clojure. If you don't already know Emacs, it is tough to learn both Emacs and Clojure at the same time. The "all in one" environments I've seen recommended most are Prelude and Emacs Live.
6) Vim with Fireplace - Vim has been through a couple phases but Fireplace is where it's at - lots of people are successful with it.
I have used both vim, emacs, and Intellij. Of the three I'm most productive in emacs.
Before writing Clojure I had been using vim for four years (and before that emacs for three) and considered myself among the best of the other developers I knew with regards to efficiency in vim. As a result I started out using it for Clojure. I found it to be painful. I was using vimclojure and only vimclojure. About a month after I switched to emacs I stumbled across this post. Had I read that before switching to emacs I could see myself enjoying that setup.
I've since switched to emacs and completely believe the learning curve is worth it but it isn't for everyone.