Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don’t disagree, but for someone who has been using JS for almost a decade, it is liberating and relaxing to use Clojure. Similar can be said about other languages that have a deliberate and thoughtful design.


but for someone who has been using JS for almost a decade, it is liberating and relaxing to use Clojure.

Can you elaborate what you find liberating and relaxing in Clojure vs modern JS?

Putting aside runtime features like multi-threading the only thing I miss a bit after having use Clojure for one year was macros. But the for the rest, is all the same, just functions and data, and some polymorphic abstractions here and there.


Tons of things actually. If I have to choose a few:

For one, JS feels clunkier with its expression/statement mish-mash. Once I started getting expression based syntax, everything made so much sense. It's such a simple feature that lets code compose granularily and is one of the key enablers for _seamless_ interactive development (and macros). One instance where this is pronounced is when you compare React JSX with Reagent and ClojureScript.

Secondly, you can do FP in JS but no matter how you do it, it feels tacked on, is typically less performant, doesn't compose as well and relies more on discipline because it isn't the default. I'm not saying FP all the things either. It's just that in interactive web GUI's you have tons of state and asynchronicity, so the type of bugs and problems that occur from mismanaging those are incredibly frustrating. There are JS libraries that mutate the stuff you pass into for no reason at all. FP by default is very, very relaxing and composes well.


Sure but those are all minor things (and greatly exaggerated) in the grand scheme of shipping stuff and producing value IMO, today, a language being mainstream and its ecosystem matters. You are falling for the exact trap the article warns about.

You'll say you can use the Java ecosystem but them you loose all the benefits you mentioned, you say you will keep interop/mutation/side effects isolated but then again you can do the same in JS if some lib is causing unwanted mutation.

I have seen JS developers run in circles around Clojure developers because the JS devs have specialized in their language and ecosystem while the others keep moving between ecosystems and niche languages hoping for some magical thing that will fix all their problems.

Rich Hickey is a great software engineer and software architect but what most don't notice is that he also is a good salesman.


There is no "trap" I fell into here. The point of the article you refer to was that there is more value in being more proficient in some language/tech choice rather than jumping around and that the ecosystem matters.

From the article

> If anything, my progress was often hampered by the lack of libraries, unreliable tools and not spending enough time in any one ecosystem to develop real fluency. These got in the way of working on hard problems, and working on hard problems was the main thing that actually led to improvement.

> By way of counter-example, check out this ICFP contest retrospective. Nikita is using clojure, a pretty niche language, but has built up incredible fluency with both the language and the ecosystem so that he can quickly throw out web scrapers and gui editors. Whereas I wouldn't be able to quickly solve those problems in any language after flitting around from ecosystem to ecosystem for 12 years.

And I largely agree with this.

> You'll mention you can use the Java ecosystem but them you loose all the benefits you mentioned, you say you will keep interop/mutation/side effects isolated but then again you can do the same in JS if some lib is causing unwanted mutation.

Been there, done that and I explained honestly above why I prefer having more explicit and built-in boundaries, rather than tacking it on via libraries and discipline. Interop, mutation and side-effects stand out and there are utilities that let you do those things in a convenient, productive way without you having to worry about copying stuff around or similar.

There are some really good libraries in the JS world too, that are a joy to work with and are powerful productivity wise. No doubt about that. I merely cited the reasons most important to me why I have a preference and why it feels liberating and relaxing to me to use Clojure over JS in general. There are more, and there are also some downsides. None of them de-validate your judgement or preference.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: