4 ms·
My point wasn't to show that Clojure can produce a concise final function -- it was to show that each step in the process of developing that function can be eva
by mbil 6y ago
My point wasn't to show that Clojure can produce a concise final function -- it was to show that each step in the process of developing that function can be evaluated within the editor (sorry, I tried to communicate this by including each form's output; not an easy process to show in a static comment), without copying and pasting to/from a REPL, without even leaving your current buffer. If you can do that with JS I would genuinely love to know (since I write JS frequently).
> Picking Clojure over JS today is a very hard sell.
I'm not sure I would choose ClojureScript over JS on the frontend. I haven't worked with ClojureScript much nor thought much about the trade-offs.
> Defaulting to immutability it's not as useful in single-threaded environments like nodejs or the browser.
It might not be as useful, but I think it's still useful. With immutability, you know that inside a scope you can do whatever you want with any data (ignoring atoms for a moment) and you're not going to step on somebody else's state.
> with the difference that JS has a big enabling ecosystem of libraries
ClojureScript has interoperability with all the JS libraries, no?
And if you need strong typing, then I'd agree Clojure is not a good fit.