First of all I should say that ClojureScript is a great tool for writing single page applications with complex client-side logic (take a look at prismatic, they use it). Another great feature of ClojureScript is that you can re-use you server-side clojure code in your scripts.
But here I want to list some small disadvantages, things that I found uncomfortable while trying ClojureScript.
Logging
Remember old good console.log:
Which looks more cleaner in CoffeeScript:
Now look at ClojureScript’s version:
You can search github and you’ll find code like this:
or this:
People don’t like to be typewriters :)
JavaScript objects
Every time you want to interact with js objects you need to use js-obj construct:
For example to send some json to server you’ll need:
Again people end up with helper functions for clojure map -> js object conversion:
</script>
Seems like there is an issue for that in clojure’s JIRA.
Debugging
Sometimes ClosureScript compiler crashes with NullPointerException and without ANY line number. It is very difficult when you need to comment lines to guess which one is failing.
All of these I’ve experienced during conversion of chat-websocket js scripts to ClojureScript. I think that ClojureScript is not good for small utility scripts because of the runtime and necessity for helper functions. Next time when I need to write some simple frontend code I’ll use CoffeeScript. But I’m still learning and trying cljs, so there will be other posts about it.