News for hackers. Stuff that matters.
Re:Rootbeer GPU Compiler Lets Almost Any Java Code Run On th... by nradov on Sunday August 12, 2012 @02:46AM (#4372049)
Wildcard imports are a bad idea regardless of whether you're using an IDE or not due to the risk of future name conflicts.
Re:Rootbeer GPU Compiler Lets Almost Any Java Code Run On th... by jburwell on Sunday August 12, 2012 @10:36AM (#4372599)
This sentiment is dogma from long ago when there was a slight performance improvement for individual imports. Today, there is no such performance advantage. Their risk of a namespace collision, but in practice, it is very rare and very easy to identify when it does. The main reason it remains is mainly due to default IDE configuration.

On the flip side, wildcard imports make coding much more fluid and concise. How many times have you had to hit ctrl+space two or more times in the same declaration to add import statements for interfaces and classes from the same package? IMHO, explicit imports greatly decrease the usefulness of the static import feature.

Re:Rootbeer GPU Compiler Lets Almost Any Java Code Run On th... by nradov on Sunday August 12, 2012 @09:26PM (#4374212)
There has never been any runtime performance difference between individual and wildcard imports. Compiled byte code is identical.
Re:Rootbeer GPU Compiler Lets Almost Any Java Code Run On th... by hythloday on Sunday August 12, 2012 @11:38AM (#4372726)
Name conflicts are a compile error - the worst thing that can happen is that you have to change it back to an explicit include.
Re:Rootbeer GPU Compiler Lets Almost Any Java Code Run On th... by mateuszf on Sunday August 12, 2012 @03:18AM (#4372084)
They are not a bad idea if you use and IDE and not an editor. IDE lets you find usages of a type instantly. Anyways such conflicts are rare.
Re:Rootbeer GPU Compiler Lets Almost Any Java Code Run On th... by hnriot on Sunday August 12, 2012 @12:11PM (#4372804)
True iff the code cannot be modified (say for example it's packaged in a jar and is closed source), otherwise this is trivially worked around on the very few times it ever happens.
Re:Rootbeer GPU Compiler Lets Almost Any Java Code Run On th... by nradov on Sunday August 12, 2012 @09:29PM (#4374219)
This issue is irrelevant for jar files. Compiled byte code contains fully qualified class names, not import statements.
Re:Rootbeer GPU Compiler Lets Almost Any Java Code Run On th... by taligent on Sunday August 12, 2012 @03:15AM (#4372081)
My point was more than Java namespaces can be easy to use.

Pretty much everyone uses an IDE anyway so it's not like namespaces are ever an issue unless you do come across that rare name clash.

Re:Rootbeer GPU Compiler Lets Almost Any Java Code Run On th... by lloeki on Sunday August 12, 2012 @05:11AM (#4372227)
> Pretty much everyone uses X anyway so it's not like Y are ever an issue

This 'its good enough, and everyone does it anyway' attitude leads us to incredibly damaging status quos.

Re:Rootbeer GPU Compiler Lets Almost Any Java Code Run On th... by Karunamon on Sunday August 12, 2012 @11:17AM (#4372670)
Often though, "good enough" really is good enough. You can spend untold man hours trying to get that last little bit of perfection and never really achieve it anyways.