Clojure Development: IDE or REPL?

后端 未结 7 1229
野趣味
野趣味 2021-02-02 13:05

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 hav

相关标签:
7条回答
  • 2021-02-02 14:10

    I think there are really 2 questions here:

    A) how to deploy (and build and manage dependencies). All I can say to that is look at other projects with similar goals/domains and copy them.

    B) Workflow:

    My work-flow is like this:

    1. open a file and write some high level wishful thinking declarations

    2. start writing some functions to support it

    2.5 copy the function definitions to REPL as I create them

    1. open another file and write some basic tests to check the function works

    3.5 copy these to the REPL

    1. iterate between the two buffers building the tests up to an example and the program toward an end goal. These eventually become similar activities and I know I’m done.

    2. wrap the secondary file up in deftest

    Now when I come back in a month, I can just run my tests and be happy! Saving your REPL buffers can provide some value with little effort. That’s just what works for me at present, and I’m happy to be educated to better approaches.

    As for selection of IDE vs REPL - most IDEs have plugins which have REPLs so I'm not sure its a one or the other choice - really its just about which text editor you are productive in, and how you want to manage your project structure. There aren't any 'do it this way' structures pre-made AFAIK so at this point it is easier to look at specific projects (like Clojure itself, or penumbra or compojure or any of the libraries listed on the main site.

    0 讨论(0)
提交回复
热议问题