42 ms·
Depends on the tooling you use and how you program. An REPL that is integrated with your editor is key. A good linter such as clj-kondo (comes with Calva on V
by dgb23 3y ago
Depends on the tooling you use and how you program.
An REPL that is integrated with your editor is key.
A good linter such as clj-kondo (comes with Calva on VSCode), helps a lot to avoid typing errors and a lot more.
Using a REPL middleware which visualizes your output such as portal is very nice.
One issue is when you get errors that involve anonymous closures. It might be harder to navigate those errors. But I don't know of a language that does this well. Clojure makes it very easy to divide and conquer though.
Another big one involves macros. Macros are powerful, but errors you get from them can be quite cryptic in some cases. Usually for common macros there are linter rules that you can use/find to avoid those.
Clojure itself has a symbiotic relationship with nils. However as soon as you interact with Java data structures you might run into exceptions here. It's something to be wary of.
Finally, spec and malli give you tools to adorn your code with little specifications to state your assumptions and guarantees. You can automatically run those while you're writing code to get sharp, human readable error messages.
So yes, Clojure error messages can be scary/confusing at times, even though it has gotten better. But there are a lot of things you can do, or have been done for you that really help here and sometimes go quite a bit beyond of what you'd expect from a more mainstream language.