Re:OK, here's the thing: this is only the entrance of the ra...
by spoondan on Monday October 18, 2010 @10:05PM
(#1805900)
The feature isn't bad, but there are several warts. The '$' is not a prefix operator on strings. The following is a syntax error:
It turns out that '$' can only operate on an identifier or another '$' expression. The '${...}' syntax, aside from being more readable and less likely to be accidentally encountered, is more like an operator:
The decision to keep (and only warn against) unescaped strings past the introduction of an incompatible feature (constants) is inexcusable. It creates oddities:
This generates a notice and prints, "foo foo foo 42". But then:
This will print, "foo foo 42 42". (Note also the difference between the meaning of ${...} within string interpolation versus outside of it.) Is this all understandable? Sure. Is it good? No.
[ Parent
| on HN ]
Re:OK, here's the thing: this is only the entrance of the ra...
by wvenable on Monday October 18, 2010 @11:31PM
(#1806098)
> The decision to keep (and only warn against) unescaped strings past the introduction of an incompatible feature (constants) is inexcusable.
It's so easy to turn those warnings into exceptions. I don't think I've seen any project in the wild that does anything meaningful with unescaped strings.