3 ms·
Yes the simplest being writing a loop to filter or map. In go you will be writing full loops and intermediate variables. I'm not going to list the go versions b
by vips7L 6y ago
Yes the simplest being writing a loop to filter or map. In go you will be writing full loops and intermediate variables. I'm not going to list the go versions because I'm on mobile.
In Java:
arr.stream().map(SomeClass::someFn).collect(toList())
How about writing a min function for all number types? In go due to no generics you'd have to write a function for every type.
In Java:
static <T extends Number> T min(T a, T b) {
if (a < b) return a;
return b;
}
My comment was more tongue in cheek at the guy above me for stating "facts" though.
- wirrbel 6y agoThis is the Java most haven't seen because their experience is with codebases predating the streaming-API, sometimes even generics. The death of Java will be Scala-written dependencies in the Maven-packages ecosystem ending up as a liability.