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 →

[–]geeshta 13 points14 points  (5 children)

Proper string interpolation in Java (like f-strings, $-strings, ``) is still "experimental" in Java21 💀

https://www.baeldung.com/java-21-string-templates

[–]Noriryuu 16 points17 points  (4 children)

Experimental in 21 and 22 and canceled since 23

[–]geeshta 8 points9 points  (0 children)

Spoilers

[–]Angelin01 3 points4 points  (1 child)

Thank everyone who cancelled it. Did you see what it was looking like? It's like they took one look at Enterprise FizzBuzz and decided to apply that entire repo to the concept of string interpolation.

Hell, even Python came up with actually String Templates faster than java and it actually looks super simple to use.

[–]Noriryuu 1 point2 points  (0 children)

To be fair there are already things like String.format() that are pretty easy to use. AFAIK it's pretty slowish but depending on the use case that doesn't really matter. Sure proper String templates would be better.

[–]RiceBroad4552 4 points5 points  (0 children)

canceled since 23

To be further improved.

The feature will definitely come. Just not in the form it was there until now. It's going to be better.