|
> I think this link says it all: http://download.java.net/jdk8/docs/api/java/util/function/pa.... I'm not sure you understand what you're looking at. Defining a "function type" in Java 8 looks like this: interface MyFunctionType {
double f(String x, Runnable y, int z);
}
That package merely defines some common types. They are all interchangeable, by the way, so if your method takes a parameter of type "YourFunctionType", defined so: interface MyFunctionType {
double foo(String a, Runnable b, int c);
}
Then the same lambda expression could represent both MyFunctionType and YourFunctionType. You don't need to use the types defined in that package, you don't need to remember what they're called etc.> Anyway, they recently started from scratch again on modularization, so pretty much all the work done on Jigsaw before that is lost anyway. I'm not sure how much is "lost", but most Java users specifically said, in this case and in others, that they prefer postponing a feature until its been done "right" after die consideration. And when a language is used by millions of developers and with trillions lines of existing code, there is a lot to consider, because a lot is at stake. |
Yes, I do. The issue is that their ideas of lambdas work exactly in those cases where using a lambda is just a nice replacement for existing AICs. With that reasoning they thought that they could get away without standard function types.
But then, they added their "bulk operations" to collections and started to realize they were in trouble, because there didn't exist any SAM types they could use _and_ coming up with names for anonymous function literals was kind of idiotic. But with function types already ruled out and time running short, they decided to make up ad-hoc function types.
A bit later, they also realized that all the boxing had a non-negligible impact on performance, so they started to add _some_ ad-hoc specializations to the already ad-hoc function types, but of course not _all_ of them. Not even mentioning that the naming is just completely out of whack.
At the same time, they started to ask people what use-cases they could think of for real Generics in Java 9. One could argue that it's a case of the left hand not knowing what the right hand does at Oracle ... but it was in fact the _same_ person who OK'ed the broken function type design in the first place who was now asking for feedback.
So in the best case, a considerable amount of types in java.util.function (did I already mention that the name is just FUBAR?) will be obsolete in the version right after Java 8 and in the worst case, those types will serve as ammunition against fixing Generics for good.
This is a good case of making every imaginable error in language design one can think of.
> most Java users specifically said, in this case and in others, that they prefer postponing a feature until its been done "right" after die consideration
Yeah. I think no one will ever argue against that. You are not making up straw men again, aren't you?
What people criticize is that what Oracle claims is not consistent with their actions. If you want to sell people the idea of delaying a feature to "get it right", for gods sake, please actually make sure you "got it right" when shipping it versions later.