Earlier quoted context omitted.
A sealed class ought to have no methods, so it is plain old data. Then there's no purpose to overriding it.
I think you're thinking of `record` classes? Sealed classes are about constraining inheriting or implementing to only approved types - using sealed is pointless without overriding of some kind. Unlike in some other languages, where sealed is closer to java's final classes, i.e. stopping inheritance.
New language features since Java 8 to 17
331–340 of 358 posts
Re: New language features since Java 8 to 17
#332Earlier quoted context omitted.
> it's lost too much ground and MS seems to be losing interest in it wat > our goal isn't to adopt the strategy of less successful products This sounds like "we don't care if some other languages have great quality of life improvements, we pretend that success (for some unknown definition of success) is the only thing that matters, so we'll keep implementing one or two features every 10 years that don't work with hal…
> wat Their focus seems to have shifted to TypeScript, and that's understandable as they have far better chances for success there. Their best hope for .NET was to make it the Pepsi to Java's Coke, but that hasn't materialised (in fact, it's getting further away). .NET has not been anywhere near the go-to alternative choice for people who just don't want Java for one reason or another in years. > This sounds like "we…
C# 9 has more features in the release (one year after the release of C# 8) than java had in the past five years.
Whatever "seems" to you, it clearly isn't true.
> > It won't, not for another ten years.
> You're very wrong about that. Remember that only five years ago, Java didn't have var, didn't have switch expressions, didn't have text blocks, didn't have records, didn't have sealed classes, and didn't have pattern matching.
Me: Java is moving too slowly
You: no-no. Some people even think we're moving too fast. Here, we have five features in five years. Some of those features should've been there 20 years ago.
> it's that we don't copy their evolution strategy.
It's a great delusion. Java's development is abysmally slow. It has nothing to do with "quick-feature-loving minority" as you so condescendingly put.
Java moves in fits and starts, taking 5-10 years to add some features that often don't fit with either the rest of the language, or with half of the standard library. Almost literally everything takes near a magnitude more boilerplate to write and develop than it should. And when it's not, it's only available to some parts of the lang, and not to the other.
But when you express concern about this? Oh, then you're a "quick-feature-loving minority", and not a developer earning their living with Java and hoping for any meaningful improvement to it.
Oh, I'm sorry. I'm not smart enough to understand why a possible solution to tolstoyesque method chaining calls that will maybe come to Java in 10 years is "evolution of the language", but literally the same solution to collections (and unifying lists and arrays) is "a quick feature from less successful languages, and we don't adopt evolution strategies from those".
As I don't understand a hundred other things that can elevate Java-the-language from mediocre to great.
Re: New language features since Java 8 to 17
#333Earlier quoted context omitted.
Is it though? just because it has lambdas, does that make it functional?
Yes. Like there is no one definition of most paradigm’s, but what used to be the most FP language, LISPS definitely don’t conform to the more strict FP-definitions like pureness, strong type system, etc. What remains is simply having functions as first class citizens and you can very much save functions into maps or whatever in Java.
having some sort of syntax for lambdas does not a function programming language make.
There's nothing about the Java syntax or design that lends its self to FP. Lambdas were bolted on to the language after the fact..
That's like saying Scheme is Object oriented because its trivial to make objects from closures, and should one decide to go deeper, you could easily define macros for classes, methods, etc.
It's grossly disingenous to call Java functional, or even compare it to other functional programming languages.
Re: New language features since Java 8 to 17
#334Earlier quoted context omitted.
Well for one, it has a repl. As per single core performance, javascript is faster and has had first-class-functions from the beginning. and you don't need 10 lines of code to print hello something to the screen. and JavaScript(ES6) is actually multiparadigm. don't get me wrong, JS has its warts (and oh my god that is indeed the case.) but you can literally run it in any browser any where, which makes for an excellent…
> Well for one, it has a repl Jshell > As per single core performance, javascript is faster and has had first-class-functions from the beginning Doubt. And no matter how I count, Java had first class functions for 8 years now, at the very least. Does it really matter when exactly did a language feature got implemented? > and you don't need 10 lines of code to print hello something to the screen. jshell: System.out.pr…
and ugly and verbose and all the things you mentions are bolted on after that fact or not even apart of the core programming language. which hurts your agreement of its being "elegant" or "designed well"
Re: New language features since Java 8 to 17
#335Re: New language features since Java 8 to 17
#336Earlier quoted context omitted.
> wat Their focus seems to have shifted to TypeScript, and that's understandable as they have far better chances for success there. Their best hope for .NET was to make it the Pepsi to Java's Coke, but that hasn't materialised (in fact, it's getting further away). .NET has not been anywhere near the go-to alternative choice for people who just don't want Java for one reason or another in years. > This sounds like "we…
> Their focus seems to have shifted to TypeScript C# 9 has more features in the release (one year after the release of C# 8) than java had in the past five years. Whatever "seems" to you, it clearly isn't true. > > It won't, not for another ten years. > You're very wrong about that. Remember that only five years ago, Java didn't have var, didn't have switch expressions, didn't have text blocks, didn't have records, d…
Not even close. They're adding small features to the language, while Java adds huge features to the runtime. .NET is 10-15 years behind Java on the runtime. Roughly speaking, Java's philosophy (going back to Gosling) has been to innovate on the runtime and keep the language conservative, while .NET's has been to add a lot of features to the language and keep the runtime relatively crude. There is no indication that changing our strategy would be a wise move.
> Some people even think we're moving too fast. Here, we have five features in five years.
Not some; most. Most people prefer fewer than five features in five years, even though many prefer more. I really wish we could make both you and the others happy, but I don't see how we can do that other than what we're already doing: have Java be the popular mainstream language, and support other languages on the platform for those who prefer something else.
> Some of those features should've been there 20 years ago.
Should have been there so that what? Or at the expense of what? Our goal is to build a successful language used by millions, not to push the envelope in programming language design (although we are pushing the envelope in runtime design). We introduce features when we think mainstream programmers could use them in the best way, and we add them slowly enough so that we're not overtaken by fashion and we have room to grow for decades. You may not like it, it's okay, and it's even perfectly reasonable. But this has worked really, really well.
> It's a great delusion.
Fine. Maybe you have more access to market data than we do. Fact of the matter is, no other language is doing any better, and Java has fewer serious competitors today than it did in the last 15 years.
> But when you express concern about this?
I am not dismissing your concerns. I am merely explaining that we have about ten million other developers we cater to aside from you, and they don't all share your opinions. Your views are far from unique, and we are well aware that many people want the language to evolve faster -- and that's perfectly legitimate although I personally don't think it's a good idea for such a popular language -- but even more don't.
Re: New language features since Java 8 to 17
#337Earlier quoted context omitted.
> Well for one, it has a repl Jshell > As per single core performance, javascript is faster and has had first-class-functions from the beginning Doubt. And no matter how I count, Java had first class functions for 8 years now, at the very least. Does it really matter when exactly did a language feature got implemented? > and you don't need 10 lines of code to print hello something to the screen. jshell: System.out.pr…
Javascript is faster than java... sorry... the JVM is slow. and ugly and verbose and all the things you mentions are bolted on after that fact or not even apart of the core programming language. which hurts your agreement of its being "elegant" or "designed well"
Also, a JIT compiler written in Java running on top the JVM interpreting (though in a clever way) javascript can match the speed of V8, just saying. Look up TruffleJS!
Re: New language features since Java 8 to 17
#338Earlier quoted context omitted.
> Their focus seems to have shifted to TypeScript C# 9 has more features in the release (one year after the release of C# 8) than java had in the past five years. Whatever "seems" to you, it clearly isn't true. > > It won't, not for another ten years. > You're very wrong about that. Remember that only five years ago, Java didn't have var, didn't have switch expressions, didn't have text blocks, didn't have records, d…
> C# 9 has more features in the release (one year after the release of C# 8) than java had in the past five years. Not even close. They're adding small features to the language, while Java adds huge features to the runtime. .NET is 10-15 years behind Java on the runtime. Roughly speaking, Java's philosophy (going back to Gosling) has been to innovate on the runtime and keep the language conservative, while .NET's has…
Ah yes. Using a single common way to initalize things and unifying arrays and lists (so that you don't need helper modules, and you don't have to rely on the kindness of libs to provide .of methods) is "fashion" (as are many other things).
But "yeah, we will maybe some day 10-20 years from now provide a way to build records, and only records, in a way that doesn't require hundreds of lines of boilerplate", that's long-term strategic planning and evolution.
Well, we're talking past each other. I'm well aware that any change in a language the scale of Java is a daunting task. But the condescending tone that dismisses something as "features for the quick-feature-mided fashion crowd" clearly shows that it's not these concerns that drive these decisions, but purely subjective outlook on things.
Re: New language features since Java 8 to 17
#339Earlier quoted context omitted.
Kotlin relies on the developer to write readable code, and just generally offers way too many ways of doing the same thing. Too much freedom of expression. Java, by virtue of being more verbose, requires writing everything out explicitly, so you really have to expend some extra effort to make your code unreadable.
"generally offers way too many ways of doing the same thing" Such as? "Java, by virtue of being more verbose, requires writing everything out explicitly, so you really have to expend some extra effort to make your code unreadable." Boilerplate is what makes code unreadable. Getters, setters, backing fields, all that noise, takes lots of space getting in the way of grasping the meaning of the code. Java is too much ab…
Re: New language features since Java 8 to 17
#340Earlier quoted context omitted.
> C# 9 has more features in the release (one year after the release of C# 8) than java had in the past five years. Not even close. They're adding small features to the language, while Java adds huge features to the runtime. .NET is 10-15 years behind Java on the runtime. Roughly speaking, Java's philosophy (going back to Gosling) has been to innovate on the runtime and keep the language conservative, while .NET's has…
> we think mainstream programmers could use them in the best way, and we add them slowly enough so that we're not overtaken by fashion and we have room to grow for decades Ah yes. Using a single common way to initalize things and unifying arrays and lists (so that you don't need helper modules, and you don't have to rely on the kindness of libs to provide .of methods) is "fashion" (as are many other things). But "yea…
I think that being honest about our strategy that dates back to Java's inception -- an innovative runtime and a conservative, slow-changing language -- that has worked well for us and so we're sticking to is more respectful than giving you some non-committal marketing response. I think you should also be respectful and understand that the Java language team is one of the most successful and experienced language design teams in the world and know what they're doing, even when people might disagree with some decisions. Even experts disagree, and people have different tastes (I find C# and contemporary Kotlin positively garish, while I think Clojure and Zig are elegant and beautiful).
And the language features Java does intend to adopt will come quickly, just as the smallish-medium ones over the last few years have. I believe lambdas were the only language feature that took more than a couple of years to deliver. Once the language team decide they want a feature, they deliver quite quickly. The features that take a long time are usually changes to the runtime (what I mostly work on), not just the language.