6 ms·
My biggest problem with Clojure (specifically ClojureScript) is that it's too workflow opinionated. Nearly all Clojure devs use 1 of 2 text editors. Nearly ever
by Touche 12y ago
My biggest problem with Clojure (specifically ClojureScript) is that it's too workflow opinionated. Nearly all Clojure devs use 1 of 2 text editors. Nearly everyone uses Leiningen. Nearly everyone uses some sort of auto-builder. Nearly everyone uses hot-swapping.
Clojure wasn't even optimized for this workflow, it's just the only one that works. So as much as I love the language I keep going away from it because I prefer the freedom of my own workflow.
- willismichael 12y agoI'm curious what language and workflow you prefer? In my opinion, there are plenty of other technologies (quite popular ones at that) that have a specific workflow considered "best practice", arguably because "it's just the only one that works".
- Touche 12y agoI prefer any language that requires nothing more than a text editor (any) and possibly a compiler. Where you can use any build system you want and be pretty much just as productive. I agree that there are other languages that suffer the same problem, the .NET languages for example (except kinda F#), but there are plenty that do not (C, JavaScript, etc).
- mjt0229 12y agoC brings in its own problems. Compiler (in)compatibilities, the need to install libraries on a machine to be able to compile and run programs. And besides, in C you still have a build system problem - Make is fine, but it is definitely opinionated about how things happen, and you potentially have to write a lot more boilerplate to get a complex project built with Make than you do for Leiningen, Maven, SBT, etc.
- Touche 12y agoYou don't have to use Make, there are a half a dozen other popular build systems.
- dkersten 12y agoI personally find that to be a horrible experience. Nothing worse than having to install a bunch of tools that you'll never use again, to compile someone else's project. For example, if you use CMake, tough, project A uses autotools. You use bjam? Project B uses QtCreator/QMake. You use Waf? Project C uses SCons. No thanks, just give me a standard build tool like leiningen and be done with it. (Ok, so its not "usually" that drastic, because there are only a handful of winners, but its happened a few times now that I've had to install Ruby - a language I don't use myself - just to run Rake to build some non-ruby software I've wanted...)
- Touche 12y agoYou're confusing the end user experience from the developer experience.
- dkersten 12y agoI don't understand how. If I'm a developer, I've got the problem I mentioned. If I'm a user, I only have the problem if I build from source. Either way, with a standardised build tool like leiningen, I don't have the problem because, as a developer, I only need leiningen. As a user building from source, I only need leiningen. Both use cases are much simpler. However, having said that, I was only referring to the developer experience in my comment. I'm not really too sure what you read it as, but like I say above, I don't think it really matters: its a problem either way and both go away with a standard build tool.
- willismichael 12y agoWell, sure you can use whatever tools you want for C, JS, etc., but then when you contribute to a project in which somebody else made the decisions (either on the job or an open source side project), then you have to learn a whole different set of workflow tools, including all of their quirks and bugs. To me, it's a breath of fresh air to be able to look at a Clojure project and immediately know where to go to find out what dependencies are pulled in, know how to run the project, etc., instead of having to dig through somebody's mad collection of Bash scripts that invoke some weird build tool that I haven't been exposed to.
- smrtinsert 12y agoLein evolved to be the winner because afaik it was simply the best at it. If another tool out did it, that would be fine with people I think, but most of what you need (and THEN some) is available as lein plugins, so there's no need to dethrone it.
- emidln 12y agoClojure (and ClojureScript) have stand alone compilers and ship very nice APIs to compile code (if you want to write your own compiler). People use lein (and its plugins) because mucking around with a compiler and then managing dependencies, setting up your classpath manually, and writing a test runner is a waste of time. As far as text editors go, you're not forced into using an nrepl-enhanced client. I got by fine on tmux+vim with no editor support for clojure other than syntax highlighting and rainbow parens for a long time. That said, having paredit, nrepl (for code completion, dynamic eval in the correct context, documentation lookup, misc other plugins), and a test runner with easy macros in my "ide" makes my experience better. There's absolutely no reason why one couldn't just use a notepad and the clojure compiler plus whatever random build system strikes their fancy.
- skratlo 12y agoWhen you're buying into a languague, you're also buying into the ecosystem, and if the ecosystem elected it's tools, and it's optimizing it's workflow towards those, then that's what it is. You either buy the whole package (leiningen specifically, I'm not sure what's the editor problem you mention), or you don't.
- dj-wonk 12y agoI'd put it this way, when you try a language, you are testing to see if the ecosystem works for you. Many, if not most, ecosystems have some kind of sweet spot where you find more support. You don't have to buy the whole ecosystem, but the more you stray the less community overlap you'll find.
- andrewvc 12y agoWell, people do use these tools, but honestly, do you really want a language with multiple build tools / package managers? The java world is a mess here. Leiningen is pretty great, no need to fragment the community. As far as editors go, I'm perplexed. You can use nearly any editor, why do you perceive the need to use one of these 2?
- Touche 12y ago> Well, people do use these tools, but honestly, do you really want a language with multiple build tools / package managers? I want multiple workflows. A single build tool can accommodate that, but Leiningen can't/doesn't. For example, let's say I have a compiler called mycc. I can build something like this: mycc main.c -o main I might then combine it with an file watcher utility like entr find . -name '*.c' | entr mycc main.c -o main With Leiningen it has to do that all. AND you pretty much have to use the auto rebuilder capability (which means your workflow starts with turning the auto rebuilder on). > As far as editors go, I'm perplexed. You can use nearly any editor, why do you perceive the need to use one of these 2? Then why do nearly all (probably 95%) Clojure devs use either Emacs or LightTable?
- dj-wonk 12y agoLeiningen, in my experience, is nicely extensible for what I've needed to do. I've got a project that has to pre-compile Protocol Buffer files. To do that, I use Leiningen profiles. Have you looked at Leiningen profiles? https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md https://github.com/technomancy/leiningen/blob/stable/doc/PRO... Plugins? https://github.com/technomancy/leiningen/wiki/Plugins https://github.com/technomancy/leiningen/wiki/Plugins It seems to me that Leiningen is quite active with its extensibility, especially given how young it is. If those don't work, have you considered wrapping it with your own scripting? Have you raised your concerns on the mailing list? People would be open to discussing them.
- Touche 12y agoYou can't wrap it with your own scripting because compiling is too slow. That's the essential problem, Leiningen has to be the center of your workflow. There's no other (meaningfully productive) way. What I dislike is the need to run a background task per-project, every time I work on the project. What I would like is either: 1) Faster (sub 500ms) compile times so that I can flexibly use a workflow I prefer. 2) A "Leiningen daemon" that runs when I start my computer and automatically compiles any project.clj files that exist. 3) ClojureScript to build in the browser, so that my workflow can be any text editor + refresh the browser. Leiningen plugins cannot give me any of those things, correct?
- mjt0229 12y agoJava has Maven, Scala has SBT, Clojure has Leiningen. That's not so bad. I use all three languages, and the appropriate tool for the language. I don't use hot-swapping for anything. For IDEs, in Clojure, you have the choice of Vim, Emacs, Cursive (for IntelliJ), Light Table, and Counterclockwise (for Eclipse), and more. All of them are good, pick your favorite.
- eropple 12y agoJava and Scala are both pretty usable with Maven or SBT (my own Java projects use SBT now). Clojure is pretty much limited to Leiningen. (And, personally, I find working with Leiningen to be a huge drag.)
- dj-wonk 12y agoWhy do you say that nearly everyone uses hot-swapping? What are some examples?
- dj-wonk 12y agoIf you have a better workflow, by all means use it and share it with us. If you want to see a community-oriented look at Clojure based on self-reported data, I'd suggest the 2013 State of Clojure: http://cemerick.com/2013/11/18/results-of-the-2013-state-of-clojure-clojurescript-survey/ http://cemerick.com/2013/11/18/results-of-the-2013-state-of-... I think you'll find considerable diversity in Clojure. You've got a confluence of people coming from Java, Ruby, Lisp, and other languages. You've got enterprises and start-ups using it. This diversity is certainly one reason that Clojure is so popular and useful to so many people.