4 ms·
This is a common misconception. I've never written a line of Java in my life, but have been a professional Clojure dev for several years. I never need to intera
by hellofunk 9y ago
This is a common misconception. I've never written a line of Java in my life, but have been a professional Clojure dev for several years. I never need to interact directly with Java, because most of the libraries you want to use do that for you anyway, and the language itself is self-supporting and comprehensive to not require interop for nearly everything.
- tosh 9y agoI'd like to second this. Clojure (& ClojureScript) have come a long way and have a vast pool of libraries and wrappers by now. It won't hurt to know something about the underlying environment you work with but you don't have to.
- chickenfries 9y agoI don't know why you assume that I haven't tried Clojure and found the requisite Java knowledge to be a barrier. How did you get into developing Clojure professionally? Personally, learning on my own through resources like Clojure for the Brave and True, I found it difficult.
- agumonkey 9y agoI'd love to hear things you disliked or found confusing. Just for the sake of seeing through others eyes.
- chickenfries 9y agoIt's been a while since I tried to get into Clojure/Cljs but when I did I remember errors like the one in this article being cryptic: https://8thlight.com/blog/connor-mendenhall/2014/09/12/clojure-stacktraces.html https://8thlight.com/blog/connor-mendenhall/2014/09/12/cloju... > Caused by: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword What's an ISeq? I can guess that' it's part of clojure's implementation from java.lang.IllegalArgumentException, but that's what I'm talking about when saying that clojure isn't a great first language because of how you have to both understand a little bit about clojure and a little bit about java, when it comes to errors and namespaces.
- hellofunk 9y agoClojure 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.
- hellofunk 9y agoI never made any assumptions re: you personally, but it is a misconception that you need to know Java to use Clojure. I started using Clojure directly by reading some books on it several years ago. I had tinkered with Common Lisp for a couple months before switching to Clojure. I convinced my company at the time to use full-stack Clojure/Script on a new project, so my experience quickly ramped up from there.
- nameless912 9y agoI mean, from my (admittedly limited) understanding of Clojure, but my significant experience with Java, this doesn't seem to be the case. Clojure lets you pretend that Java objects are essentially record types, and there's only a couple extra bits of syntax you need to know. Other than that, You can almost completely ignore the existence of Java in Clojure. How else is it possible that it's been ported to JavaScript, CLR, etc.?