Starting a new ClojureScript project in 2022. Setup suggestions

I’d say that 2 / 3 is the biggest issue.

Finding the “right” way to do things was hard because of all the noise from ways that were either a) outdated, b) not right for what I wanted.

Obviously this was compounded by my cli tools being outdated. But it was VERY hard to discover that this was what the problem was. Error messages from failures never mentioned the version of CLI tools (or which tool was specifically the problem)

So to an extent, also 1 for “confusing tooling”, in that the various cli tools are not well explained / demarcated. Your explanation here is the clearest, most informative thing I’ve read about them.

Had I been able to identify the “right” tutorials, the mere fact of more steps probably wouldn’t have been a problem. But yeah, I think the the labeling of options etc. is also confusing in cli.

(BTW: what’s this syntax of -X:blah:blah? etc? It’s neither traditional command line options, nor EDN. It seems like a bit of a kludge which is impenetrable to anyone who is coming cold to it.)

4 is obviously phrased contentiously. But there’s an aspect that, yes, people new to something need some clear guidance without being confronted with all the ambiguity and all the options that experts use.

I’m not saying that the senior devs have to give us the one true way. But someone, somewhere, ought to have an up-to-date “getting started” guide and it would be good if the official Clojure pages (first result of almost all google searches) knew about and could link to it.

To re-emphasize. What’s sad is that I got into and fell in love with Clojure, 8 years ago partly because the onboarding experience was so good then. At that time I had been dabbling with Haskell, and had become frustrated with a couple of things. Somewhere, somehow I read someone saying something nice about Clojure. I remembered all the hype about Lisp goodness too. (I’d played with Lisp but never used it in anger). And on a whim I decided to try what I’d been thinking of doing in Haskell in Clojure (with Quil I think, to do some graphics).

The fact is that within an hour or so I’d installed Clojure, started playing and made enough progress that I was convinced to continue my project with it. Even though it was completely new to me. I was as productive within a couple of days as I am in anything.

I’m very glad I did try it and did have this experience. I love Clojure. I’m convinced it’s the best language I’ve ever used. And it’s my first choice for anything I want to do.

But had, 8 years ago, I hit the kind of stumbling blocks and frustrations I hit in the last week or so, in just trying to boot my project up, I’d have almost certainly given up and either gone back to Haskell or just decided to do it in Python. And I suspect many people today might be having this problem.

I don’t really want to blame or fault senior devs or people behind Clojure for this. Except maybe in that it feels that Leiningen has been a really solid, established and easy to use standard for building and managing Clojure projects. And it seems a bit “high handed” for the Clojure community to decide that it’s deprecated and we should all move onto something else, less beginner friendly. That has created a lot of confusion.

I wish they’d either worked with the Leiningen people to evolve Leiningen and fix what they thought was missing from it, or at least made the UI to CLI building more similar to / compatible with Lein.

Why couldn’t, they, for example, have just used a project.clj file? (Or at least a project.edn file which was closer to the Lein one?) Why not use the same terminology where possible? Leiningen has “lein run”. Why does cli need “cli -X:dev” rather than “cli run dev”? None of these are big issues in their own right, but dozens of them all add up to the sense of confusion and disempowerment if you are coming from lein and expect that you should be able to adapt reasonably quickly. (I don’t expect changing a command-line tool / build-system in a language / ecosystem I already know to have the same learning curve / studying requirements as getting into a whole new language.)

Obviously I accept that “people coming from Lein” and “people new to Clojure” are not the same group.

But where there’s a common theme: Lein successfully encapsulates and hides complexity. Which was great for new users. But also for everybody.

With CLI tools, the Clojure team has decided that hiding complexity is not a priority compared to their other goals. But no-one is telling us that “beginners should use Leiningen, CLI is for advanced users”. The opposite, there’s a strong implication that CLI is the way to go.

But really, if they were going to replace Lein with something new, they should have at least aimed to learn from it, and match it, in terms of complexity hiding.

3 Likes