Hacker News new | past | comments | ask | show | jobs | submit login

Which is a nonsensical reasoning they're also requiring a template processor, so string templates were previously impossible in two different ways.

`\{` as an interpolation leader would make sense if untagged string literals became implicit STR templates, but that's not the case.




I guess they want to force you to choose interpolator. So that you won't implicitly use STR when you should have explicitly use SQL.


> I guess they want to force you to choose interpolator.

In which case using `\{}` as the interpolation signal is completely unnecessary, because the new syntax already solves the backward compatibility concerns.

Using just `{x}` like C# and Python, or `$x`/`${x}` like Kotlin, would have sufficed and made the syntax a lot more palatable.

So would using postfix format specifiers, because that printf-style prefix garbage is just gnarly.


\{ protects you from forgetting to use interpolator at all. No other syntax that uses same delimiters as string literal would.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: