[swift-evolution] Thoughts on replacing \() with $() or some other symbol
Dany St-Amant
dsa.mls at icloud.com
Wed Jun 22 18:45:15 CDT 2016
> Le 22 juin 2016 à 12:27, Brandon Knope via swift-evolution <swift-evolution at swift.org> a écrit :
>
> I really don’t understand why we are wasting everyone’s time debating this.
>
> Yes I think there is a correlation. Yes this is precisely why I posted the heat map.
>
> Of course \ is not needed a lot, but when it is, *it is inconvenient for *some* people*. I am not making this up. You can cite several other users from this very thread.
>
> I tried showing that it is quite distant on the keyboard from where the user’s hands rest. I tried showing that there are other keys at their finger tips where their hand is usually resting.
>
> 1. Do I know every international keyboard layout? No.
> 2. Are we pretending that \ was picked because it was easier for international users? If I am wrong, I would love to hear more…else let’s not pretend that \ was the optimal key for all.
The same that a good sentinel value is one that is invalid. A good escape character is one that is rarely used. If as suggested $() or @() is used, one would have, unless extra look ahead magic is added to the parser, would have to write string like "0.99\$" and "swift-evolution\@swift.org"; that's assuming only \() is changed and not all escaping. Using @ or $ for all escaping is so ugly to me, that I cannot write an sample of what it would look like.
One could of course argue that the look ahead is tiny, but escaping in the rare case that "$(" need to be displayed one would have to use "\$("; so some $ need escaping, whic can be seen as inconsistent and confusing.
So sticking to '\' looks like a good idea.
Dany
More information about the swift-evolution
mailing list