2 ms·
"Java libraries are poorly-designed, the prospect of wrestling with them again brings back memories of frustration." One of the best things about Clojure is ho
by jimbokun 18y ago
"Java libraries are poorly-designed, the prospect of wrestling with them again brings back memories of frustration."
One of the best things about Clojure is how it makes Java libraries suck much less. For example, line-seq turns a Java BufferedReader into a lazy sequence of String's, one for each line in the file.
http://clojure.org/api#toc334 http://clojure.org/api#toc334
You still have the suckiness of the multiple lines it takes to instantiate and clean up the BufferedReader, but macros like with-open makes that suck a little bit less, too.
http://clojure.org/api#toc612 http://clojure.org/api#toc612
Stir in some macro-fu of your own, and now you have the benefits of Java libraries minus the boilerplate suckiness. Basically, it turns Java into a "your language features are my libraries" language, no mean feat.