DIP16: Transparently substitute module with package

Jonathan M Davis jmdavisProg at gmx.com
Sat Apr 7 10:44:09 PDT 2012


On Saturday, April 07, 2012 18:45:15 Jacob Carlborg wrote:
> On 2012-04-07 02:25, Jonathan M Davis wrote:
> > On Friday, April 06, 2012 08:09:28 Steven Schveighoffer wrote:
> >> I feel like most people will still import the main package module, and
> >> not
> >> the submodules.  I don't think I ever wrote a piece of java code that
> >> didn't have:
> >> 
> >> import java.io.*;
> > 
> > Which is actually considered bad practice in Java, though a lot of people
> > do like to do it. What's generally considered good practice is to
> > explicitly import every module/class, and Eclipse likes to underline
> > imports in red if you don't.
> 
> import foo.bar.*
> 
> Is used all over the place in SWT.

Like I said, some people do like to do it, but Eclipse doesn't like you to, 
and there are quite a few Java folks who argue that it's bad practice. I 
forget what the reasons were (maybe increased buld times due to pulling in 
more symbols or more issues with symbol conflicts - I don't recall), but I 
wasn't particularly convinced when I heard them. Regardless though, there's a 
definite contingent against importing with * in the Java community, and it was 
my understanding that that contigent was the majority of that community, but I 
don't know.

- Jonathan M Davis


More information about the Digitalmars-d mailing list