Hacker News new | ask | show | jobs
by Scarbutt 2615 days ago
Why pick Typescript instead of Javascript as a comparison? there's really not that much difference in your example if plain javascript objects/arrays/functions was used.

Clojure has better and more map handling functions in the std lib for sure, but I find that with the help of some libs you can write lots of Javascript in a Clojury way without too much hassle.

2 comments

Typescript is becoming a popular alternative to JS and is often being chosen to correct the perceived shortcomings of JS. Just like ClojureScript, which is often chosen to correct the perceived shortcomings of JS ;)
You picked on static typing, which Clojurescript doesn't have.
I picked on needless complexity due to top-down design not on static typing per se.

Here's a good video highlighting the difference of approach. Well worth watching. Applies to how many Java architects would design a solution. I see the same kind of top-down approach happening in the Typescript area as well.

https://www.youtube.com/watch?v=Tb823aqgX_0&list=PL0ydHZ1qvY...

Yes, and Clojure exists in opposition to static types. There is always core/typed, but Rich Hickey does not like static types and Clojure was not intended to be written in that way. These days, with languages like TypeScript on the rise, static types are more fashionable than ever whereas Clojure appears to not be having the same momentum. While I like my static types very much, it never hurts to try to understand both perspectives and what they offer. To sell Clojure these days, you first have to sell dynamic types.
Its statically typed, object oriented style is a good contrast to cljs.