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

...yes, but that comes with burden of complexity and (usually) bad design decisions (like using core async).

Its not just night & day, closurescript > js; a lot of very good stuff exists there, but immutable by design isn’t a silver bullet that magically makes problems go away, and it (cljs that is) does introduce its own problems.

Practical examples of where cljs is tangibly a better choice is probably more useful to people.

For example, I personally have fought a cljs modal that kept an open channel waiting on user input; but when the modal closed, the channel was still there waiting and when it reopened there were now two channels, both getting input events, doing twice the work. Bad design, and not fp at all.

How did immutable structures help? Not at all. The author just used a global state atom to store everything anyway.

I’m just saying; yes, in clojure immutable is on by default, and that is good... but I don’t think I’ve observed, particularly, better code & lower bug rates in the cljs code I’ve worked on as a result...



Oh yes, definitely there are plenty of other tradeoffs involved with CLJS vs JS that are much more nuanced, and as you said, immutable by default is by no means a silver bullet. There's a reason why I still by choice use JS for certain projects when CLJS exists.

I was only lamenting what I consider to be the only major deficiency in JS when it comes to writing functional code, one that I haven't really found any viable way to work around, despite being quite happy with most other aspects of the overall experience of writing functional JS.




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

Search: