Yes that is the real reason.

It is an open source absolute requirement (it is not just, cause it looks
nice).

Open source code is usually REALLY reviewed, meaning that on average at
least 1.5 persons will read your line.

If you did review code you would know why.

Seeing Attributes bla bla bla and not knowing what package it comes from
makes it VERY hard to read, in fact IMPOSSIBLE until you know the actual
full package.  you have to find manually what class that package comes from.
So what are you going to do... well? I can go and search all packages for
"ATTRIBUTE"  or I can go to the top of the page and see the class.

It is one of those things that you have to do once to really go 'but of
course'...

marcf

|-----Original Message-----
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED]]On Behalf Of Ole
|Husgaard
|Sent: Sunday, June 24, 2001 11:29 AM
|To: [EMAIL PROTECTED]
|Subject: Re: [JBoss-dev] Reasons for using Explicit Imports?
|
|
|Hi,
|
|Another reason: It makes it easy for the code reader
|to quickly find out the package a particular class is
|in: You just search for the class name from the start
|of the source file.
|
|
|Best Regards,
|
|Ole Husgaard.
|
|
|Scott M Stark wrote:
|>
|> So you can know what is being used and in general wild card imports
|> cannot be used as this causes conflicts when two packages have a
|> class with the same name(Attributes for example):
|>
|> import javax.naming.directory.*;
|> import org.xml.sax.*;
|>
|> class tstImport
|> {
|>     public static void main(String[] args)
|>     {
|>         Attributes attrs = null;
|>     }
|> }
|> bash-2.04$ javac tstImport.java
|> tstImport.java:8: reference to Attributes is ambiguous, both
|class org.xml.sax.Attributes in org.xml.sax and class
|> javax.naming.directory.Attributes in javax.naming.directory match
|>                 Attributes attrs = null;
|>                 ^
|> 1 error
|>
|> ----- Original Message -----
|> From: "Matt Veitas" <[EMAIL PROTECTED]>
|> To: <[EMAIL PROTECTED]>
|> Sent: Sunday, June 24, 2001 6:56 AM
|> Subject: [JBoss-dev] Reasons for using Explicit Imports?
|>
|> Could you briefly explain the reasoning behind EXPLICIT IMPORTS? What is
|> wrong with using wildcards. My guess is that by looking at the explicit
|> import list you can have some sense of what exactly is being used or is
|> there a performance issue?
|>
|> Matt
|>
|> _______________________________________________
|> Jboss-development mailing list
|> [EMAIL PROTECTED]
|> http://lists.sourceforge.net/lists/listinfo/jboss-development
|
|_______________________________________________
|Jboss-development mailing list
|[EMAIL PROTECTED]
|http://lists.sourceforge.net/lists/listinfo/jboss-development



_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to