Nice to see that Records are finally out of preview. But note that Sealed Classes are still in Preview mode and are subject to change (or removal) in newer versions.
Very cool to see that Scala continues to have a huge impact on Java’s roadmap.
Records and Sealed Classes are borrowed from Scala.
Could be not the best news for new Scala adoption, but good news for developers having better abstractions in Java
Edit: Kotlin, and other languages should also mentioned since they also include similar features. I still think Scala has had the most influence over the years.
We see similar developments with C# borrowing features from F#, with records in v9, pattern matching, etc.
While it's good for C#/Java, it does make it harder to push for adoption for a language such as Scala and F#. Why bother investing in the languages with a much smaller market share when the big boys adopt good bits and pieces from them constantly?
This is why it's so important to have different programming languages! Sometimes it's hard to do things differently when you are just looking at your own programming language, and the tools it has available to it. Not everyone programming language needs to be a behemoth to be useful to other people. I say keep making new an interesting programming languages! It will only lead to better programming languages over all
I think Kotlin is more at risk than Scala on the server at least. Scala still has a lot of advanced features that sets itself apart. Kotlin is a better Java but Java is catching up fast.
I hope they're subsidizing the Scala project, and Kotlin too. Nothing better for a dominant player than having other people scout the territory for you.
Can't read whether this is sarcastic or tongue in cheek ;-)
Java 11 is the newest LTS release.
The next LTS release will be Java 17.
Many companies won't touch anything that isn't LTS. There are still a large number of companies staying on Java 8 :shrug:
As a student most of the way through a Java course, I'm wondering what Java is still used for. Java applets are dead, Android is moving on to Kotlin (apparently Google got in legal trouble with Oracle even though Java is "open source?"), and I can't think of any desktop applications that use Java anymore. Java is supposed to be able to "run anywhere," yet C++ is more portable because it doesn't require the JVM to run.
Yet clearly I'm mistaken, since Java is still one of the most popular languages.
Edit: also please help me understand - do I have to pay for a license even though Java is open source? Is this normal for other languages too?
Happy with the number of comments on this release.
HN is a funny place.One day you are convinced no smart person on HN is still writing Java and the next day you see droves discussing about a java release.
Super interested in https://openjdk.java.net/jeps/386 as alpine linux is at the heart of a lot of docker images. We use ubuntu currently as our base image, but tried to use alpine recently and ran into some issues with musl.
I am curious where does it leave libraries like Lombok that basically ports a non-record type Java class to make it more record type-e by adding things like @Value, @Data annotations. Are those libraries/frameworks going to become obsolete now?
Hopefully, there will be a day/release in the Java world when we will be able to write 10x - 20x shorter programs (in terms of LOC) with most mundane stuffs disappearing under the hood. Sighs!!
It will be interesting to see the reaction of project managers some of whom still measure productivity in terms of lines of code/# of commits! (yeah, they do and still exist).
I did, the main issue is that jaotc doesn't do any pruning of the unused methods, so it generates too much assembly code.
If i remember correctly, compiling just guava was to close to 1 gig.
GraalVM native image is far better, it "compiles" more slowly but the resulting executable is not too big.
[+] [-] benjiweber|5 years ago|reply
Compiletime checked state machines with Sealed Classes [preview feature] https://benjiweber.co.uk/blog/2020/10/03/sealed-java-state-m...
Autobuilders, Mixins, Conversions & more with Records https://benjiweber.co.uk/blog/2020/09/19/fun-with-java-recor...
Pattern Matching fun https://benjiweber.co.uk/blog/2021/03/14/java-16-pattern-mat...
[+] [-] bob1029|5 years ago|reply
https://docs.microsoft.com/en-us/dotnet/csharp/pattern-match...
Being able to combine pattern matching with switch expressions has allowed us to construct extraordinarily concise state machines for our UIs.
[+] [-] elric|5 years ago|reply
[+] [-] exdsq|5 years ago|reply
[+] [-] dadoge|5 years ago|reply
Records and Sealed Classes are borrowed from Scala.
Could be not the best news for new Scala adoption, but good news for developers having better abstractions in Java
Edit: Kotlin, and other languages should also mentioned since they also include similar features. I still think Scala has had the most influence over the years.
[+] [-] mdm12|5 years ago|reply
While it's good for C#/Java, it does make it harder to push for adoption for a language such as Scala and F#. Why bother investing in the languages with a much smaller market share when the big boys adopt good bits and pieces from them constantly?
[+] [-] Decabytes|5 years ago|reply
[+] [-] bishop_mandible|5 years ago|reply
I think records already existed in FORTRAN and other languages like ALGOL-60. C has structs, too.
[+] [-] meddlepal|5 years ago|reply
[+] [-] JohnKacz|5 years ago|reply
[+] [-] eweise|5 years ago|reply
[+] [-] wpietri|5 years ago|reply
[+] [-] u678u|5 years ago|reply
[+] [-] sireat|5 years ago|reply
[+] [-] BoyRobot777|5 years ago|reply
[+] [-] closeparen|5 years ago|reply
[+] [-] kronin|5 years ago|reply
Java 11 is the newest LTS release. The next LTS release will be Java 17. Many companies won't touch anything that isn't LTS. There are still a large number of companies staying on Java 8 :shrug:
[+] [-] hasa|5 years ago|reply
[+] [-] dangerboysteve|5 years ago|reply
https://inside.java/podcast/#:~:text=The%20Inside%20Java%20P...!
[+] [-] myroon5|5 years ago|reply
[+] [-] chronogram|5 years ago|reply
[+] [-] tmp7oaje|5 years ago|reply
Yet clearly I'm mistaken, since Java is still one of the most popular languages.
Edit: also please help me understand - do I have to pay for a license even though Java is open source? Is this normal for other languages too?
[+] [-] kaladin_1|5 years ago|reply
HN is a funny place.One day you are convinced no smart person on HN is still writing Java and the next day you see droves discussing about a java release.
[+] [-] whalesalad|5 years ago|reply
[+] [-] btown|5 years ago|reply
[+] [-] java-man|5 years ago|reply
[+] [-] mooreds|5 years ago|reply
Hopefully this version will work better.
[+] [-] JCWasmx86|5 years ago|reply
[+] [-] suyash|5 years ago|reply
[+] [-] pkphilip|5 years ago|reply
http://docwiki.embarcadero.com/RADStudio/Sydney/en/Propertie...
You can have Get and Set methods for properties or even allow direct access to the variable itself.
type TCompass = class(TControl) private FHeading: THeading; procedure SetHeading(Value: THeading); published property Heading: THeading read FHeading write SetHeading; ... end;
Also, properties can be indexed.
type TRectangle = class private FCoordinates: array[0..3] of Longint; function GetCoordinate(Index: Integer): Longint; procedure SetCoordinate(Index: Integer; Value: Longint); public property Left: Longint index 0 read GetCoordinate write SetCoordinate; property Top: Longint index 1 read GetCoordinate write SetCoordinate; property Right: Longint index 2 read GetCoordinate write SetCoordinate; property Bottom: Longint index 3 read GetCoordinate write SetCoordinate; property Coordinates[Index: Integer]: Longint read GetCoordinate write SetCoordinate; ... end;
Properties can also have "property pages" which can show specific user interfaces for viewing/setting these properties.
https://www.delphipower.xyz/guide_8/adding_a_property_page.h...
I have yet to see anything of this sophistication in Java or for that matter in any other component framework.
[+] [-] yellow_lead|5 years ago|reply
[+] [-] seahawks78|5 years ago|reply
[+] [-] ObscureScience|5 years ago|reply
[+] [-] JulianMorrison|5 years ago|reply
[+] [-] stonemetal12|5 years ago|reply
[+] [-] cferr|5 years ago|reply
[+] [-] randomopining|5 years ago|reply
[+] [-] dehrmann|5 years ago|reply
[+] [-] EdwardDiego|5 years ago|reply
[+] [-] BoyRobot777|5 years ago|reply
[+] [-] aogl|5 years ago|reply
[+] [-] bartvk|5 years ago|reply
[+] [-] setheron|5 years ago|reply
Just finished my CPU architecture and enjoying to see the new trend to adopt vectors again in the USA
[+] [-] seahawks78|5 years ago|reply
It will be interesting to see the reaction of project managers some of whom still measure productivity in terms of lines of code/# of commits! (yeah, they do and still exist).
[+] [-] Fiveplus|5 years ago|reply
[+] [-] _old_dude_|5 years ago|reply
GraalVM native image is far better, it "compiles" more slowly but the resulting executable is not too big.
[+] [-] tannhaeuser|5 years ago|reply
[+] [-] JCWasmx86|5 years ago|reply
[+] [-] seattle_spring|5 years ago|reply