3 ms·
Clojure doesn't have the most obvious errors in the world to a newcomer, that is true. A good book on Clojure will quickly remove any confusion about what ISeq
by hellofunk 9y ago
Clojure doesn't have the most obvious errors in the world to a newcomer, that is true. A good book on Clojure will quickly remove any confusion about what ISeq means, but a bit of practice makes those low-level understandings not required.
The article you mentioned accurately says this:
> Although Clojure's errors are notoriously unfriendly, they're easy to read with a bit of practice
Once you realize that much of what happens in Clojure is based on data sequences, it becomes clear that an individual keyword is not a sequence, so it was probably used incorrectly somewhere.
That's an interesting article comparing the errors from Ruby with Clojure. They are about the same, the only difference is that Clojure gives you a lot more information in the form of an ugly stack trace. Fortunately, many editors in Clojure automatically hide the stack trace and only show the error.
After you've seen errors a few times in your first week using the language, fixing them becomes second nature. This is one of the tradeoffs using a dynamically typed language: there will be more debugging of runtime problems. In return for that, you spend less time on other things. The fact that there are very successful languages in both the dynamic and static typed camps shows that benefits can be found everywhere.
- agumonkey 9y agoI wonder what would happen if vanilla clojure came with a commonlisp style debugger on error. CL errors can be intimidating but the interactive debugger makes things almost fun.
- hellofunk 9y agoFigwheel has time-travel debugging, which is nifty. To be honest, my debugging is quite basic and quick, I've been doing it long enough that when I see an error it's clear what the fix is almost immediately. I suspect this is what happens in most languages regardless of their error handling mechanisms.