|
|
|
|
|
by jitl
886 days ago
|
|
They want to ensure the new interpolation sequence is a compiler error in non-template strings, so that the incorrect “hi \{name}” is an error instead of silently doing the wrong thing. Using \{ accomplished this because it’s an unknown escape sequence in older Java (so forbidden there), and in new Java will have the more specific error of “yo you forgot the template processor at the start of your template”. |
|
And editors will use different colors.
Using \ or $ is not about backward compatibility but about ergonomics.