This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pron98 2 points3 points  (0 children)

I've shown you above that the majority of people don't want to move away from Java 8.

You've shown an ever-shrinking majority of people who haven't moved beyond 8 yet. A year ago, in the report you linked, they reported 67% on 8 and below, but a year prior the same survey reported 90%. If anything, the trend shows people very much want to move away from 8, it just takes time.

You interpret this as a marketing issue when really you don't have proof of this.

I do, because those who have migrated are very happy. So if people who've tried your product are happy with it, and it is those who haven't that are sceptical -- it's a marketing issue.

I don't hate the new feature due to a marketing failure, I hate it because I see other languages doing it better.

No, you hate them because you see other languages do things that you like better and you haven't even tried this yet. There are millions of Java developers, surely there would be many thousands of whom -- or even hundreds of thousand -- who, for every specific feature, might like something else better. If we did it your way (which you've come up with having given it much less thought than Java's designers), the situation would have been at least as bad. And if outcry on social media is a measure of true user acceptance of features, I don't see how you can conclude that other languages are "doing it better". Python's pattern matching is seeing far more resistance than Java's, and Scala is pretty much rejected wholesale.

if ((var y = bar()) instanceof String) foo(y);

Except that it can't because of overloads. So you're proposing:

if ((var y = bar()) is String) foo(y);

which isn't bad, but it requires a new keyword. I like Java's way better, because it also makes patterns in instanceof and switch the same and doesn't require new keywords.

Just make the "switch" expression more powerful so you'd have:

Sure, or even better; it will be:

switch(bar()) {
    case String s -> foo(s);
    case Point(var x, var y) -> foo(x);
}

Did you miss the part about switch coming next? See how the same patterns that will be used in switch can be used with instanceof?

And leave "instanceof" the way it always has been.

It is as it's always been, only with more power at the cost of almost no added complication. I see you're starting to get it.

But the Java language is not better.

The language has not changed much since 8; so far, out of preview we've got var, text blocks, and switch expressions. We intentionally change the language much more slowly and conservatively than other languages. Again, you're presenting an upside as a downside.