6 ms·
... import com.gs.collections.impl.block.factory.Comparators; import com.gs.collections.impl.block.factory.Functions; import com.gs.collections.impl.block
by jlarocco 14y ago
...
import com.gs.collections.impl.block.factory.Comparators;
import com.gs.collections.impl.block.factory.Functions;
import com.gs.collections.impl.block.procedure.CollectionAddProcedure;
import com.gs.collections.impl.collection.mutable.AbstractCollectionAdapter;
...
Gees, I feel sorry for people still stuck using Java.
- koko775 14y agoWhy? It's pretty good, all things considered.
- laluser 14y agoYou 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 :)
- arcdrag 14y agoNo Java devs actually type any of that. Java IDE's are very good at generating this sort of code...for this very reason. No one would still be using Java if they actually had to remember full package names.
- jrockway 14y agoThat's not true; many of us still use Emacs and Vi and do remember package names.
- ecopoesis 14y agoWhy? Because Java has good, built-in, worldwide namespacing that always works? Or because Java has IDEs that pull in imports automatically so developers don't have to think useless shit? Or is it because you're fanboi who dislikes Java merely because it's Java and choose any opportunity, not matter how inappropriate, to disparege it. Java is by no means perfect, but let's at least pick on it for the things it actually does poorly rather then just picking on it because it's no longer considered cool.
- runn1ng 14y agoI hate auto-generated code by IDEs. It always produces stuff like... that.
- eropple 14y agoAnd then hides it. Which I'll agree is a little stupid, but you never really see it in practice.
- arcdrag 14y agoYou realize that any modern language is nothing more than an abstraction layer to automatically generate code in a lower level language right? The only difference here is that if you view the .java file in a plain text editor, you'll actually see that block. You won't see it in modern IDE's though. It gets automatically collapsed, as it is an aid to the compiler more than the developer.
- hermanhermitage 14y agoOne viewpoint is such noise doesn't scale - both for tooling or human consumption. Java and C# are both heading into a territory where it is getting less reasonable for a human to write them without tooling support - is this what people really want? If we have such sophisticated tooling why bother dropping to low level text? Wouldn't it make more sense to manipulate and compose more expressive objects than text? The end game is you obsolete the languages and they become targets of more expressive languages. It highlights a potential design flaw in the composition model of the language and/or the libraries. Should for example C/C++ include the generated assembler in pragmas to guide compilation? Always? Visible to the programmer?
- pjmlp 14y agoSo does your favourite language use modules to help organize large scale applications? If so, how do they look like?
- f45s8g2 14y agoIf they, i.e. the rest of the company outside of the IT department, don't know how much better things could be with something smaller and faster, then it really does not matter. Oracle has had companies locked in for decades. And they have developers locked in. They are like Microsoft. Maybe Github and more open source visibility is the beginning of a change. It is exposing what Java really is: to some observers it is a bloated mess. When we have internal corporate use cases of Java being made public like this, more comparisons of doing these tasks in other languages can be performed by people outside the company, and I have no doubt we will see some benchmarks done. And we may see that Java is slower than other alternatives. Peer review, via putting things in an open repository, might be a powerful force for improvement in software. But if I were Oracle, Microsoft or another company that tries to lock in business customers, which only promotes its own software and does little to advance the state of the art (or even actively inhibits it, e.g. killing OpenSolaris) I would not be too happy with this trend.