Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Excessive use of import wildcards  RSS feed

 
Gerd Rosarius
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello folks,

currently I am involved in a complex Java project. For me this mean, fighting through a huge bunch of classes written by several programmers. The software itself lacks performance heavily.

Beside architectural problems I see excessive use of import wildcards like
instead of .

I know that this is far away from beeing good coding style but does it lead to reduced performance at runtime, too? Any ideas?

H.-Gerd
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All it does is potentially cause the compilation of the source to be a bit slower and/or take a bit more memory.
It doesn't affect runtime performance in the least.

And remember: whether it's good or bad coding style depends on personal preference.
I've seen conclusive arguments for using only wildcard imports, only specific class level imports, or any type of mix of the two according to whichever seemingly arbitrary rule.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeroen is right. In fact, imports are just a convenience for the developer - they don't have any effect on the generated byte code at all. The byte code always only contains fully qualified class names.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!