commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Chaffee / Purple Technology <>
Subject Re: import * vs explicit debate
Date Thu, 03 Apr 2003 00:40:48 GMT

So I don't really mind if the vote goes the other way, but I thought
I'd respond, as nobody else seems to be starry-eyed...  

My main complaint with explicit imports is that is cripples a *very*
handy IDE feature (auto-complete).

On Wed, Apr 02, 2003 at 06:49:35PM -0500, Gary Gregory wrote:
> Here are my pennies: We uses "explicit" imports as computed by Eclipse's
> "Organize Imports" feature. 
> Before saving or committing a file, we (usually) all do a
> CTRL-SHIT-O/Organize Imports and a CTRL-SHIFT-F/Format. (It would be nice if
> this were done automatically when you save a file, someday maybe.) Eclipse
> uses "explicit" imports, which I personally like for the following reasons:

Eclipse actually lets you set the threshold wherever you like.  It
will go * after one, two, twelve, or whatever.  Same for IDEA.

> (0) It is clearer, no mysteries.

...until the list gets larger than 7 and then it's back to being

> (1) You can see how "involved" or coupled a type is in other packages'
> business.

Well, you can see how *many* packages it's coupled to more easily with

But nobody has yet told me how often this is actually useful.  Real
decoupling/refactoring takes actual comprehension of the object model
and semantics; an import list won't help with that.  And if you're
computing coupling there are lots of code metric tools available that
give you arguably more useful measurements (though I've never found
these particularly useful -- instead I refactor as I go and find that
if I visit a module, that's evidence that deserves cleaning).

> "Import statements must be fully qualified for clarity." from
> "All import statements should containing the full class name of classes to
> import and should not use the "*" notation" from

If the rest of the Apache project jumped off a bridge... :-)

It's a religious issue, I'll give you that.  At least we've all agreed
not to use tabs, right?

Alex Chaffee                     
Purple Technology - Code and Consulting
jGuru - Java News and FAQs       
Gamelan - the Original Java site 
Stinky - Art and Angst           

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message