5 ms·
Similar point to this is wildcard imports in Java. Previously I prefer import bla.* because it's shorter and neater, but as the code grows, more naming conflic
by wiradikusuma 5y ago
Similar point to this is wildcard imports in Java.
Previously I prefer import bla.* because it's shorter and neater, but as the code grows, more naming conflict and more difficult to find where's where, I prefer explicit import. I can configure my IDE to collapse the import lines anyway.
- EdwardDiego 5y agoYeah, most code styles in JVM code bases I've worked in (Kotlin and Scala included) prohibit wildcard imports, reviewing PRs is a lot harder when you're playing "Where did the function/class come from".
- jbverschoor 5y agoThe big problem doesn't exist in Java, as it's being compiled, and all classes used are fully qualified in the bytecode. In source-based languages, if a library adds some class, you'll get into some trouble. In Java, this will also happen at source level, but results in not being able to compile.