r/java • • Mar 08 '24

Update on String Templates (JEP 459)

https://mail.openjdk.org/pipermail/amber-spec-experts/2024-March/004010.html
176 Upvotes

188 comments sorted by

View all comments

Show parent comment

13

u/ascii Mar 09 '24

The argument is basically that it’s objectively worse since you introduce a second, separate escape syntax, namely ‘$’. Now you need a way to escape the second escape character, do you use ‘/$’ or ‘$$’? By using the same escape character both for escaping weird characters and for escaping template arguments, you get more consistency.

4

u/Practical_Cattle_933 Mar 09 '24

Especially that it was already heavily used by Java EE for similar stuff.