4 ms·
Pythonist's thoughts on Clojure after 3 days of learning and coding
- j_baker 16y agoThese are very valid criticisms, especially the error issue. That's probably my biggest gripe about clojure. The huge error tracebacks for trivial mistakes almost brings back memories of C++ templates. I mentioned one of these particular instances on the mailing list once but didn't get any response. Perhaps it just isn't that big a deal once you work with the language a lot.
- sunkencity 16y agoThe error messages are decent when working from emacs/slime I think. My major problem is that it's rather unpredictable what kind of exceptions that can be thrown where, makes it a bit hard to write defensive code. Other than that, I like it.
- fogus 16y agoIt definitely is a big deal and I can't say for sure why your particular message was ignored -- maybe it was lost in the haze. In any case, there is an active effort to make error messages more coherent and will get better as time progresses.
- weavejester 16y agoThere are a few libraries around (like clj-stacktrace) that significantly improve the quality of stack traces. There was some talk about integrating a library like that into clojure.core, but I'm not sure if any progress has been made on it. It's a known issue, and definitely up there on the priority list to fix.
- barnaby 16y agoI'm a Pythonista working on Groovy (and Grails) and I have a similar complaint about the error messages given by the Java stack. Groovy is one hell of a groovy language but the Java error output that it gives is comically long, and overall pretty useless. I rely almost exclusively on log output and step debugging. To J_Baker's point, no you don't get used to that kind of thing, it's still annoying after 3 months to have to scroll through 2 pages to find a single reference to a method you were working on, and then it's not even the line where you had the problem.
- jsankey 16y agoI work in Plain Old Java most of my day, but have side projects in both Clojure and Python. I agree with the consensus here about the error traces in Clojure, but I'd like to point out this is not inherent in the platform. When I'm programming in Java, I find the stack traces to be a massive advantage in diagnosing issues, as they present a lot of detail right down to the location of the problem (Python is similar in this respect). Irrelevant plumbing may bloat the traces a bit, but usually quite separated from the important lines, and having too much information is rarely an issue for me. I think the problem with Clojure (and perhaps Groovy too), is that the compiler/runtime for the language invades the traces. If you look at the example given in the original post, almost the entire trace is Clojure plumbing. That's the real issue, and it's not the fault of the Java stack.
- barnaby 16y agoThere's probably truth to that. I don't remember Java error output being that bad back when I worked with it years ago. It does seem like many of the lines in Groovy output are groovy plumbing, like which closure was called.
- code_duck 16y agoScala can give out some pretty elaborate and useless error messages, too - for example, recently I tried to import a Java library in the REPL, and received a 45 lines traceback which culminated in the interpreter exiting.
- expeditious 16y agoThe author writes: > Scheme comes with too little in the language to use easily for much beyond teaching programming. This commonly-cited reason seems to ignore implementations that include much more than what the standard specifies.