Clojure Development: IDE or REPL?

Viewed 4157

I've been using Clojure for a little while and want to create some projects that are bigger and more complicated than toys. I've been using Java for the past few years and have become accustomed to what IDEs do for me -- compile lots of classes, package them up in jars, create batch files for users to start them with.

When I look at examples of development in Clojure they seem to be along the lines of load files into the REPL, see how they work, edit the file, reload, repeat. Nary a class or jar being generated anywhere. In Stuart Halloway's terrific "Programming Clojure" I couldn't find a single example of ":gen-class", for example. The Clojure IDEs that I have used (ClojureBox and the enclojure NetBeans plugin) seem to promote that same work flow.

Is this intentional? Are the tools too immature or do I just not "get it"?

I'd like to hear some work flow examples from folks who have created some non-trivial programs to be used by regular users (not other devs) if possible.

Thanks for sharing your opinions.

7 Answers

I use both - Eclipse IDE and Counterclockwise plugin which provides a REPL. This is a particularly nice combination if you develop Java code alongside Clojure (as I do).

My general approach is:

  • Write Clojure code in the editor
  • Keep a REPL open for testing things out (Ctrl+Enter is a useful shortcut here: it executes whatever code is selected in your editor in the REPL)
  • Use the generic IDE tools for project management, building, testing, SCM etc.

At times , I also work purely in the REPL. This is usually better for testing things out quickly. If I particularly like a piece of test code, I will simply copy/paste it from the REPL into my test suite.

Related