C
Chris McMahon
I'm currently deciding on whether our development team should explictly
list classes or use package wildcards for their imports. I've been
explicitly listing classes for years now, but the development team has
been using wildcards instead.
It seems to me that it is easier for people unfamiliar with your code to
understand where classes you're referencing are coming from by looking
at your imports when there are no wildcards. On the other hand, modern
IDEs do make looking up classes relatively easy. I have noticed that
JDKs and a lot of modern open source projects list imported classes
explicitly.
I don't want to be an unnecessary pain to the development team if there
are good reasons for going with wilcards, but my experience so far tells
me it is better to list things explicitly.
Any opinions on this?
list classes or use package wildcards for their imports. I've been
explicitly listing classes for years now, but the development team has
been using wildcards instead.
It seems to me that it is easier for people unfamiliar with your code to
understand where classes you're referencing are coming from by looking
at your imports when there are no wildcards. On the other hand, modern
IDEs do make looking up classes relatively easy. I have noticed that
JDKs and a lot of modern open source projects list imported classes
explicitly.
I don't want to be an unnecessary pain to the development team if there
are good reasons for going with wilcards, but my experience so far tells
me it is better to list things explicitly.
Any opinions on this?