Nicolai Parlog

@nipafx
1.7K Followers
135 Following
617 Posts
#Java enthusiast focused on language features, core APIs, and runtime evolution with a passion for learning and sharing - mostly at conferences and in his biweekly Inside Java Newscast. He's a Java Developer Advocate at Oracle (views are his own) and otherwise best known for his haircut.
Websitehttps://nipafx.dev
GitHubhttps://github.com/nipafx/
YouTubehttps://youtube.com/nipafx
Twitchhttps://www.twitch.tv/nipafx

Java stream's terminal operations `findFirst` and `findAny` are neat but one use cases isn't covered: "find the only one" - a terminal operation you'd use after a filter that's supposed to let exaxctly one element pass through.

There's now a JDK preview with that operation, named `highlander`. โš”๏ธ

"Everybody wants code reviews until they get punched in the face."

- Mike Tyson (pretty much)

Just leaving this here... #JavaOne
Until then, here's a little behind-the-scenes footage from the build-up. ๐Ÿคฉ

If you're using #Javaโ€‹'s source-file launcher, you may eventually want to drop some dependencies into your little project. But how to get them without a build tool?

One answer is JPM - give it a shot, it's cool: https://github.com/codejive/java-jpm

The #Java YouTube channel just passed 200.000 subscribers. Woot! ๐Ÿฅณ Thank you, everybody, for watching, commenting, sharing, and just in general for being an active member of this awesome community. ๐Ÿงก๐Ÿ’™

https://www.youtube.com/java

Before you continue to YouTube

How should I know what I think without reading what I wrote?

The next time you accidentally call a Java release "an LTS version", remember:

* it happens to the best (in this case the authors of JEP 14)
* it's easy to fix

Friends don't let friends use misnomers.

OpenJDK is on a roll right now! Leyden just submitted its first JEP: "Ahead-of-Time Class Loading & Linking".

https://openjdk.org/jeps/483 #Java

JEP 483: Ahead-of-Time Class Loading & Linking

JVMLS takes place next week - be there or be... on YouTube: https://youtube.com/java

That's what I'll do and I can't wait to watch the talks with updates on Babylon, HAT, Valhalla, Lilliput, and so many more. #Java

Bevor Sie zu YouTube weitergehen

ร—
Just leaving this here... #JavaOne

@nipafx so it ships next year, right? ๐Ÿ˜

(Kidding, making a reference to your mention after the keynote)

@nipafx in all seriousness though, this JavaOne ROCKS!!! ๐Ÿค˜
@nipafx genuine interest and I don't mean to troll. Are proper immutable collection framework and the val keyword being discussed among the Java architects?

@FranDayz I'm sure they are being discussed but afaik the sentiment is that they won't be added for now.

When 'var' was introduced, the community didn't agree on 'val' vs 'final var' vs 'let' vs other options and because finality of local variables isn't that essential, the decision was made to not add an additional keyword. I don't think anything has changed in that regard.

I wrote an article outlining the issues with backfitting immutable collections: https://nipafx.dev/immutable-collections-in-java/

Immutable Collections In Java - Not Now, Not Ever

The JDK contains immutable collections, but no type ImmutableCollection. Here's why that's so and why it won't change.

nipafx // You. Me. Java.
@nipafx thank you so much for the answer and the article!

@FranDayz And don't worry about trolling, I love to answer questions like this. You could even say, it's my job. ๐Ÿ˜‰

Questions that annoy me and might get a more quippy answer usually start with "Why don't you just..." and end with "... like Scala/Kotlin/Go?". ๐Ÿ˜

@nipafx thanks! And it's interesting that you mention Kotlin. It's been a language I used to convince people to work with in the past, but after the latest developments with Java, specially sealed classes, records, enhanced switch, I've been more like not seeing the point in adopting Kotlin anymore. Only thing that "kinda bothers me" is the lack of features like the ones I inquired in my initial post. But it's still exciting to see how Java evolves.
@nipafx ah and something like Kotlin s copy method!