4 ms·
I looked at Clojure at one point and fell in love with the lispy but not too parenthetical syntax. I left it behind after a while because I couldn't deal with t
by zhemao 13y ago
I looked at Clojure at one point and fell in love with the lispy but not too parenthetical syntax. I left it behind after a while because I couldn't deal with the awful exception tracebacks which were supremely unhelpful when debugging. Most of the more arcane messages had to do with fundamental syntax errors, which was probably not as big a deal for an experienced programmer. However, it made it very difficult for a bigger to debug when you couldn't so much as see the line number on which you made the mistake.
They may have fixed that recently, and this CSP implementation is really cool, so I may take a look back at the language.
- edoloughlin 13y agoI agree that the exception traces are pretty awful. Having used Clojure for a couple of years now, all I can say is that you do get used to them. Despite the complexity of the libraries and the 'foreign-ness' of the concepts coming from an imperative background, Clojure is fundamentally a simple language/environment. I've developed a sense for the types of mistakes that I usually make and I tend to scan the stacktrace for my own namespace, ignoring the clojure.* lines[1]. Once I see what line caused the problem, if it's not a typo then it just takes less than a minute to reason about what's going on and find a solution. The REPL helps a lot, because you can make changes on the spot or try out a modified code fragment. As some others have said here: yes, it is difficult to make the adjustment from an imperative way of thinking but it's really, really worth it once you get there. [1] You can probably even de-emphasise clojure.lang stacktrace lines in Eclipse using the Grep Console plugin but I'm not sure about this off the top of my head, because the Eclipse console might override stderr output.
- zhemao 13y agoOh, I'm familiar with functional programming. I had played around with Scheme for a bit before moving to Clojure and used Common Lisp and OCaml afterwards. It was always just the terrible stack traces and really long startup times that drove me away.