The big, bad Eclipse is great for whipping a massive java source tree into shape, fast. But for Clojure - its a different, more thoughtful development idiom. You don't need to browse complex type hierarchies and fold 1000s of lines of code every other second. Debuggers are, although available, not usually necessary due to the functional nature of things : problems can be directly isolated.
Thus - I don't want heavyweight java project management in a dynamic language environment, and I don't any need refactoring fanciness. Here is how to transform Eclipse into a super-productive, lightweight IDE for zen-style Clojure development:
- Install counterclockwise from the Eclipse Marketplace by searching for it - or just add it via http://ccw.cgrand.net/updatesite.
- Go to window->Open Perspective->Remote System Explorer and find your Clojure source code folders. This is a handy trick that is little known in eclipse - you can use your file system as a "left panel" for browsing files. Dynamic languages, which don't benefit from IDE managed source code the way C++/Java does, are dominated by a market of "simple" editors that provide this sort of lightweight interface.
Why Eclipse - what about the XXX IDE ?
After bouts with VI, Coda, BBEdit, and even (briefly) emacs, I finally settled on eclipse for the following reasons :
- Its stable.
- It works.
- Its free.
- The Counterclockwise plugin is completely self installing.
- It "knows" java - so even if you don't write a lot of java, you can easily have a mock java project for browsing through APIs and method names, just for fun, along side your clojure development environment.
- Eclipse doesn't have to be heavy weight ! You can use it as a simple text editor if you follow the steps above.
What about other plugins ?
Well... lets see....
- NetBeans boasts the "Enclojure" plugin, but it doesn't transparently and easily install in the latest netbeans (1.7). I also found that, due to dependency conflicts, the Enclojure plugin doesn't readily install even in the suggested version, 1.6.9
- IntelliJ is not 100% free, although La Clojure is.
- The beautiful TextMate is not free, although David Nolen's plugin for Clojure in TextMate is free.
- Coda 2 is not free, and although Coda used to support a "Clojure.Modes" plugin (i.e. fro SubEthaEdit), the new Coda is not backwards compatible. Plus, its over 75$ and its not cross platform !
- Emacs + Slime ? These are effective and well tested, but difficult to use if you come from the VI world.
- VIM ? The vim-eclipse plugin is effective -- but do you really want to use it for large projects ?
Conclusion
(= :happiness (+ :eclipse :counterclockwise :remote_mode))

I... don't get it. Why would I want to use the Remote System Explorer instead of the default Project Explorer?
ReplyDeleteProject explorers are great - especially when you have an eclipse style j2E project. But with Clojure, the paradigm is heavily biased to wards agile text-editing + repl usage. The long refactorings, and IDE console/runtime environment aren't really necessary.
ReplyDeleteMost people don't realize that eclipse can simply be used as a Coda-styled text editor. Much simpler and easier than imposing a project hierarchy...