2 ms·
I’d go further and say they shouldn’t provide STR. The difference in syntactic (in)convenience between "..." + foo + "..." + bar + "..." and STR."..
by layer8 3y ago
I’d go further and say they shouldn’t provide STR. The difference in syntactic (in)convenience between
"..." + foo + "..." + bar + "..."
and
STR."...\{foo}...\{bar}..."
is negligible. And then the syntax
FOO."..."
would at least imply that some special processing is going on.
- pron 3y agoExcept then it would still be absolutely trivial for people to write their own string-interpolating template processors, which they would definitely do, and so we figured we might as well offer a standard one (that also offers better performance than hand-rolled ones). It is difficult to find the right balance between educating people to do "the right thing" as we see it and rolling with the recognition that they not always will. I wish we could say there's some formula we apply, but we need to exercise such judgment with lots of features and it's never a trivial decision. In this case we figured that if we make the thing people will want to do anyway no easier than the "right thing", that's probably as good as we can do, all things considered.