Remix.run Logo
▲ biglyburrito 43 minutes ago

Java still inexplicably doesn't have first-class support for string interpolation/templates. They were slated to add it in Java 23, but they removed it from the preview and it hasn't been seen since.

https://www.happycoders.eu/java/string-templates/

▲pjmlp 40 minutes ago | parent [-]

Because the feedback on how they worked apparently wasn't that positive.

Also who cares having to use String.format() in the agentic coding age?

▲kbenson 19 minutes ago | parent [-]

Honestly, I still write a lot of perl, and while interpolation is nice and good to have for simple things, I find myself using sprintf more and more in production code, especially in the cases the examples always show off, such as needing to alter the variable, add two together, etc. I assume those are just shown to illustrate you you can do that, and not imply you should, because commonly using arbitrary code execution within interpolation is something I'd feel compelled to beat out of my coworkers if I encountered it regularly.