3 ms·
You don't have to be so explicit: import com.gs.collections.impl.*; Just out of curiosity, how are imports done in your language of choice?
by laluser 14y ago
You don't have to be so explicit:
import com.gs.collections.impl.*;
Just out of curiosity, how are imports done in your language of choice?
- jabr 14y agoI can't speak for jlarocco, but my concern is not directly the import statements, but rather, what those import statements imply. That repo has 1,290 files. Excluding file pathnames containing 'test', there are 601 files. Of those, 430 are .java files. Java is complicit in that crime, but Enterprise Java is the bigger culprit. The library makes doing a map on an array cleaner for me, but behind the scenes it is using a dozen "factories", a bunch of "builders", several "strategies", and a handful of "visitors", "bridges", and "proxies". And guilt by association is valid here. We bleed over whether semicolons are needed in some languages, but Java is off limits for needing 10-fold more boilerplate code for something most languages handle out of the box?
- jrockway 14y agoThis has nothing to do with Java. I thought the same thing until I started working for Google. There, I saw correctly designed APIs that are pleasant to use, all while still being standard Java. As an example, with Google's collection library (Guava), you might create a set like: import com.google.common.collect.ImmutableSet; ImmutableSet<Foo> foos = ImmutableSet.of(bar, baz, quux); This is simple syntax for a simple operation, which is the point of libraries. (Goldman also has a lot of mutable data structures. I don't think I've used or created a mutable data structure at Google ever :)