Re:Swift System Is Now Open Source
by cutler on Saturday September 26, 2020 @03:45AM
(#24597113)
It's just downright clunky. What's wrong with ${variable} as in Kotlin and Javascript?
[ Parent
| on HN ]
I think that’s more a question of taste/what one is used to. I find that dollar sign a bit heavy, visually, but one could also argue that’s a plus.
Using backslash has the advantage that there’s only one ‘special’ character in strings, but of course, also has the problem can escape any character with a backsplash, except for opening parentheses.
They had good reasons, it means there's only two substrings that need escaping: the backslash and end string sequence. In hindsight, it's ugly and hard to read. A case of optimising for the wrong thing.