News for hackers. Stuff that matters.
Re:Java String Interpolation final in Java 23 by david_allison on Saturday January 13, 2024 @09:29AM (#38980220)
C# introduced `#nullable enable` to change the behaviour of reference types.

Java could do the same to change the behaviour of `$` inside a string (along with a project-level config to make this the default).

Let developers opt-in to better syntax, rather than using significantly worse syntax to support legacy code

https://learn.microsoft.com/en-us/dotnet/csharp/nullable-mig...

Re:Java String Interpolation final in Java 23 by ghusbands on Saturday January 13, 2024 @10:21AM (#38980718)
It's moot, anyway, as parser changes are already required by the STR." part. About the only possible defence is that one could use the same lexer, but even that's not true because you can presumably now embed a multi-line string in a single-line string, like so:

  STR."\{STR."""
  \{hey}
  """}"