On Sep 8, 2014, at 10:08 AM, Jacob Goodson <[email protected]> wrote: > Hey Sam. I too had great difficulty with clojure interop until I became more > familiar with Java.
Yeah, the interop can be painful, especially with the way some Java libraries are "designed" - and you can end up with some pretty ugly Clojure when dealing with those libraries (still a lot nicer than the Java you'd have to write!). > I find that it is quite difficult to use clojure unless one knows Java, which > I believe to be a barrier to new comers. I'm surprised every time I hear this. You can write a lot of Clojure without having to do any interop so you can mostly ignore Java altogether unless you specifically want to work with a Java library. Yes, the stacktraces bleed Java but after the initial "OMG!" shock, they're generally easy to read - they're just LONG and you have to ignore a lot of the irrelevant parts. Leiningen mostly hides the ugly Java ecosystem as regards library management so, again, you can mostly ignore Java there too. Certainly if you're new to Clojure and don't know Java, you want to avoid doing things that require you to interop with Java libraries until you're more comfortable with Clojure itself. > So I suggest that you learn some Java and start trying to hack simple interop > programs to get the hang of it. Good advice. Practicing with interop on the Java String class or something else that's relatively "simple" is a nice way to ease into it. Having had to work with Java's JDBC classes, javax.mail, and Java's SOAP implementation - all from Clojure - all I can say is that some Java interop is easier than others, but most of it is somewhat unpleasant :) Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-1880)
signature.asc
Description: Message signed with OpenPGP using GPGMail
