Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] Coding conventions for AspectJ

I hate to spend time on trivia like this, but I've recently been reminded that coding conventions are extremely important when multiple developers work on the same code base.

The basic coding conventions for this project are simple.  We follow the eclipse coding conventions (which are essentially the SUN coding conventions) found at http://dev.eclipse.org/coding.html

However, there is (at least) one issue that isn't specified there that we need to agree on.  That is when to use "import java.util.*;" vs. "import java.util.List;".

I propose the following rule.  Use the '*' form whenever you would have more than 2 non-star imports from the same package.  When programming in eclipse, this means that in Organize Imports everyone should set the number of imports before '.*' is used to 2.

My opinion is that this offers a compromise between being able to easily see the exact 1 or 2 classes used from a particular package and reducing the excessive verbosity that occurs when 10-20 classes are used from a single package.

I think that a discussion of the exact value of this number would be a waste of time.  However, I expect that some people might be attached to the eclipse default value of 99 (or essentially infinity) and I'd like to give them a chance to weigh in on what the AspectJ policy should be.

-Jim


Back to the top