I agree that wildcards make it "easy" (in the nearness sense), but from a 
long-term maintainability standpoint, I'd prefer to have explicit imports 
as is.  When I'm reading your code a year from now and need to look-up the 
docs on a class, wildcards make me (and anyone else in the future) have to 
do that look-up every time.  It's almost the same argument as to why (:use) 
is a bad idea--you're dumping a bunch of symbols into your namespace.  So, 
you're trading some upfront ease for some long-term simplicity.

Yes, lots of Java tutorials are of no help in this endeavor :(  (Again, see 
the parallel in the Clojure world with so much "getting started/example" 
code showing :use instead of :require).

-Curtis


The argument for wildcards is very simple.  Go to just about any Java 
tutorial, for example:

>
> http://docs.oracle.com/javase/tutorial/displayCode.html?code=http://docs.oracle.com/javase/tutorial/2d/images/examples/LoadImageApp.java
>
> The sample code starts off with a dozen wildcard imports.  If I want to 
> try to use these techniques in Clojure, I have absolutely no idea which 
> specific classes to require.  This creates a tremendous obstacle to 
> consuming Java libraries.  This has affected me personally on several 
> occasions, preventing me from successfully figuring out how to use some 
> Java library from Clojure.
>
> Maybe it's not ideal if Clojure has to walk the classpath, but the 
> alternative is that I have to manually walk the classpath and jars myself 
> with no idea what I'm looking for.  Surely it's better for this to be 
> handled through an automated process.
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to