Thoughts on replacing \() with $() or some other symbol

While I agree with you, readability is *so* much more important than
typeability that I think this line of argument doesn't count for much.

···

on Tue Jun 21 2016, Brandon Knope <swift-evolution@swift.org> wrote:

Maybe this is flawed, but I think it is hard to argue that the \ is
easy to type when there are far more usable alternatives.

--
Dave

I agree big time. It is pretty awkward to type and I completely understand the angst when having to type it!

$() seems like the better option, though maybe not as nice looking as \() (maybe it is on second thought?) it is much easier to type!

Brandon

···

On Jun 21, 2016, at 5:22 PM, Saagar Jha via swift-evolution <swift-evolution@swift.org> wrote:

%, at least to me, suggests distant evaluation; i.e. parameter passing at the end. $ seems more like an in-place evaluation, like how bash does it.

On Tue, Jun 21, 2016 at 2:14 PM Xiaodi Wu via swift-evolution <swift-evolution@swift.org> wrote:
That said, I think it's nice that \, #, $, and @ are all used in unique scenarios. What about going a little classical with %?

On Tue, Jun 21, 2016 at 16:10 Dave Abrahams via swift-evolution <swift-evolution@swift.org> wrote:

on Tue Jun 21 2016, Kenny Wyland <swift-evolution@swift.org> wrote:

> Hi all,
>
> I'm new to the list and I just searched through the archives as best I
> could to see if someone else had already brought this up, but I didn't find
> anything. Forgive me if this horse has been beaten.
>
> I find that typing \(var) is very disruptive to my typing flow. The more I
> code in Swift, the more I like it, but every time I'm coding and then have
> to hiccup while typing \ then ( causes me to be annoyed. I know, it's
> minor, but it isn't a key combination that flows quickly.
>
> I would much rather have $() or perhaps ${} (like Groovy lang) or perhaps
> @() to go along with other uses of @ throughout the language.
>
> A shifted key, like $ or @, followed by another shifted key like (, allows
> for a much faster flow and they are much closer to the home keys than \
> which is nearly as far from home keys as possible (and awkward).

I'm forced to agree that \ is quite awkward for something that may be
used so pervasively, and $ would likely meet more peoples' expectations.

--
Dave

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

--
-Saagar Jha
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Actually… we can go pretty scientific on this sort of thing and heat map
keyboard usage to get a better picture of how “usable” this is.

I pasted a file that contains seven \’s in it and heat mapped it at
https://www.patrick-wied.at/projects/heatmap-keyboard/

Even *with* several \’s throughout my source file the majority of my key
presses take place much closer to the $ key than the \ key.

I think we can all argue about what is clearer or not, but I think for the
majority of us, the \ key is quite inconvenient compared to the keys around
where we type the most.

I also ran several of iOS 10’s sample code through the heat map and
continue to get pretty similar results: the \ is much further from the
hottest part of the keyboard than the ones closer to where your hand
usually rests.

Maybe this is flawed, but I think it is hard to argue that the \ is easy
to type when there are far more usable alternatives.

I'm rather unpersuaded by this line of argument. The keyboard is only so
big; it's a stretch to say that any key is less than absolutely usable.
Moreover, \ is next the delete key, which I presume you use frequently and
find no difficulty in reaching.

You know what *is* unusable though? Try finding the $ key on an
international keyboard.

···

On Tue, Jun 21, 2016 at 6:08 PM, Brandon Knope via swift-evolution < swift-evolution@swift.org> wrote:

Brandon

On Jun 21, 2016, at 6:10 PM, Daniel Resnick via swift-evolution < > swift-evolution@swift.org> wrote:

I also disagree for the same reasons that Gwynne and Brent mentioned: I
find '\(...)' easy to read, fine to type, and consistent with other string
escaping syntax.

On Tue, Jun 21, 2016 at 3:55 PM, Brent Royal-Gordon via swift-evolution < > swift-evolution@swift.org> wrote:

> I find that typing \(var) is very disruptive to my typing flow. The
more I code in Swift, the more I like it, but every time I'm coding and
then have to hiccup while typing \ then ( causes me to be annoyed. I know,
it's minor, but it isn't a key combination that flows quickly.
>
> I would much rather have $() or perhaps ${} (like Groovy lang) or
perhaps @() to go along with other uses of @ throughout the language.

Even though I'm used to Perl's and Ruby's interpolation syntaxes, I
immediately liked `\(…)`. It's parsimonious: Rather than taking a third
character (besides \ and ") to mean something special in a string literal,
it reuses one of the existing ones. There's no need to escape a character
you wouldn't otherwise have to touch, or to think of another character as
"magical" in a string. It fits nicely with the rest of the syntax, with `\`
indicating a special construct and then `()` delimiting an expression, just
as they do elsewhere in the language. It's an elegant solution to a problem
traditionally solved inelegantly. It's very Swifty in that way.

> A shifted key, like $ or @, followed by another shifted key like (,
allows for a much faster flow and they are much closer to the home keys
than \ which is nearly as far from home keys as possible (and awkward).

I don't have any trouble typing it personally. If you find yourself
accidentally typing `\9` or `|(`, we could probably offer an error for the
former or warning for the latter with a fix-it. But if you're complaining
that it takes a tiny fraction of a second longer to type than `$(` would,
then honestly, I just can't bring myself to care. Swift optimizes for code
reading. If we wanted to optimize for code typing instead, we'd have a very
different style.

--
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

How can it be unpersuasive? I can *show* you that keys that are easier to type/reach exist for a large majority of user’s.

I am not saying it is a good idea or not to replace \, but to pretend that there isn’t an inconvenience there is unfair when every other part of the language is put under a magnifying glass for the sake of grammar, newbie friendliness, or this or that, etc...

This is measurable…it just depends on whether it bothers people or not enough. Most other things are based on opinion, but this *can* be based on numbers and usability.
This is something used by everyone. The usability cost is there and it is real. Just because “well it is easy for me to type” does not mean that it is ideal. It also doesn’t mean that the current choice is the wrong choice either. But it still is important to discuss while we can.

And yes a keyboard IS only so big, but the range to that bigness can be pretty… big.

Also, $ is not the only option. There are still far easier keys to type than \.

Brandon

···

On Jun 21, 2016, at 7:15 PM, Xiaodi Wu <xiaodi.wu@gmail.com> wrote:

On Tue, Jun 21, 2016 at 6:08 PM, Brandon Knope via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
Actually… we can go pretty scientific on this sort of thing and heat map keyboard usage to get a better picture of how “usable” this is.

I pasted a file that contains seven \’s in it and heat mapped it at https://www.patrick-wied.at/projects/heatmap-keyboard/

Even *with* several \’s throughout my source file the majority of my key presses take place much closer to the $ key than the \ key.

I think we can all argue about what is clearer or not, but I think for the majority of us, the \ key is quite inconvenient compared to the keys around where we type the most.

I also ran several of iOS 10’s sample code through the heat map and continue to get pretty similar results: the \ is much further from the hottest part of the keyboard than the ones closer to where your hand usually rests.

Maybe this is flawed, but I think it is hard to argue that the \ is easy to type when there are far more usable alternatives.

I'm rather unpersuaded by this line of argument. The keyboard is only so big; it's a stretch to say that any key is less than absolutely usable. Moreover, \ is next the delete key, which I presume you use frequently and find no difficulty in reaching.

You know what *is* unusable though? Try finding the $ key on an international keyboard.

Brandon

On Jun 21, 2016, at 6:10 PM, Daniel Resnick via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I also disagree for the same reasons that Gwynne and Brent mentioned: I find '\(...)' easy to read, fine to type, and consistent with other string escaping syntax.

On Tue, Jun 21, 2016 at 3:55 PM, Brent Royal-Gordon via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
> I find that typing \(var) is very disruptive to my typing flow. The more I code in Swift, the more I like it, but every time I'm coding and then have to hiccup while typing \ then ( causes me to be annoyed. I know, it's minor, but it isn't a key combination that flows quickly.
>
> I would much rather have $() or perhaps ${} (like Groovy lang) or perhaps @() to go along with other uses of @ throughout the language.

Even though I'm used to Perl's and Ruby's interpolation syntaxes, I immediately liked `\(…)`. It's parsimonious: Rather than taking a third character (besides \ and ") to mean something special in a string literal, it reuses one of the existing ones. There's no need to escape a character you wouldn't otherwise have to touch, or to think of another character as "magical" in a string. It fits nicely with the rest of the syntax, with `\` indicating a special construct and then `()` delimiting an expression, just as they do elsewhere in the language. It's an elegant solution to a problem traditionally solved inelegantly. It's very Swifty in that way.

> A shifted key, like $ or @, followed by another shifted key like (, allows for a much faster flow and they are much closer to the home keys than \ which is nearly as far from home keys as possible (and awkward).

I don't have any trouble typing it personally. If you find yourself accidentally typing `\9` or `|(`, we could probably offer an error for the former or warning for the latter with a fix-it. But if you're complaining that it takes a tiny fraction of a second longer to type than `$(` would, then honestly, I just can't bring myself to care. Swift optimizes for code reading. If we wanted to optimize for code typing instead, we'd have a very different style.

--
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

\{} is kinda nice because it mirrors the closure syntax.

- Dave Sweeris

···

On Jun 21, 2016, at 17:26, Xiaodi Wu via swift-evolution <swift-evolution@swift.org> wrote:

The \( combination takes a little getting used to, but it's not absurdly terrible. I suppose we could consider \{} or even \ instead of \() to alleviate the reach.

I also disagree for the same reasons that Gwynne and Brent mentioned: I find '\(...)' easy to read, fine to type, and consistent with other string escaping syntax.

Those are persuasive arguments. Consistency with other string escaping syntax is a huge plus. Moreover, now that I think about it, \r or \n isn't really a bother to type. The \( combination takes a little getting used to, but it's not absurdly terrible. I suppose we could consider \{} or even \ instead of \() to alleviate the reach.

Gwynne and Brent indeed hit on the logic for the original design: backslash is already an escape character in strings. The parentheses () over another kind of delimiter were originally to match calls (string interpolation once generated direct calls to String initializers), but even without that it’s still something that’s used with expressions, while curly braces {} are used for general code blocks and square brackets are used with collections.

I’m strongly in favor of keeping things the way they are, both because I like it a fair bit and because it’d be another source-breaking change that would be very hard to migrate.

+1. I really liked this when I Swift was first released. Using the existing escape character makes perfect sense. We've made enough breaking changes for what are arguably aesthetic preferences. The bar should be higher going forward and I really don't think this makes the cut.

···

Sent from my iPad

On Jun 21, 2016, at 5:51 PM, Jordan Rose via swift-evolution <swift-evolution@swift.org> wrote:

On Jun 21, 2016, at 15:26, Xiaodi Wu via swift-evolution <swift-evolution@swift.org> wrote:

On Tue, Jun 21, 2016 at 5:10 PM, Daniel Resnick via swift-evolution <swift-evolution@swift.org> wrote:

Jordan

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

I completely agree with Jordan.

This is a classical bikeshed, and any new design would have to be extremely compelling, because it would have to overcome the advantage of the \() approach: that it is compatible with the use of \ as the escape character for other things. It would be really unfortunate to have to start escaping $ or whatever other character you would pick.

-Chris

···

On Jun 21, 2016, at 3:51 PM, Jordan Rose via swift-evolution <swift-evolution@swift.org> wrote:

On Jun 21, 2016, at 15:26, Xiaodi Wu via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

On Tue, Jun 21, 2016 at 5:10 PM, Daniel Resnick via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
I also disagree for the same reasons that Gwynne and Brent mentioned: I find '\(...)' easy to read, fine to type, and consistent with other string escaping syntax.

Those are persuasive arguments. Consistency with other string escaping syntax is a huge plus. Moreover, now that I think about it, \r or \n isn't really a bother to type. The \( combination takes a little getting used to, but it's not absurdly terrible. I suppose we could consider \{} or even \ instead of \() to alleviate the reach.

Gwynne and Brent indeed hit on the logic for the original design: backslash is already an escape character in strings. The parentheses () over another kind of delimiter were originally to match calls (string interpolation once generated direct calls to String initializers), but even without that it’s still something that’s used with expressions, while curly braces {} are used for general code blocks and square brackets are used with collections.

I’m strongly in favor of keeping things the way they are, both because I like it a fair bit and because it’d be another source-breaking change that would be very hard to migrate.

I’m not saying its necessarily *easy* to type, but I think its good enough to warrant the elegance of having only one escaping character instead of multiple.

···

On 22 Jun 2016, at 01:08, Brandon Knope via swift-evolution <swift-evolution@swift.org> wrote:

Actually… we can go pretty scientific on this sort of thing and heat map keyboard usage to get a better picture of how “usable” this is.

I pasted a file that contains seven \’s in it and heat mapped it at https://www.patrick-wied.at/projects/heatmap-keyboard/

Even *with* several \’s throughout my source file the majority of my key presses take place much closer to the $ key than the \ key.

I think we can all argue about what is clearer or not, but I think for the majority of us, the \ key is quite inconvenient compared to the keys around where we type the most.

I also ran several of iOS 10’s sample code through the heat map and continue to get pretty similar results: the \ is much further from the hottest part of the keyboard than the ones closer to where your hand usually rests.

Maybe this is flawed, but I think it is hard to argue that the \ is easy to type when there are far more usable alternatives.

Brandon

On Jun 21, 2016, at 6:10 PM, Daniel Resnick via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I also disagree for the same reasons that Gwynne and Brent mentioned: I find '\(...)' easy to read, fine to type, and consistent with other string escaping syntax.

On Tue, Jun 21, 2016 at 3:55 PM, Brent Royal-Gordon via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
> I find that typing \(var) is very disruptive to my typing flow. The more I code in Swift, the more I like it, but every time I'm coding and then have to hiccup while typing \ then ( causes me to be annoyed. I know, it's minor, but it isn't a key combination that flows quickly.
>
> I would much rather have $() or perhaps ${} (like Groovy lang) or perhaps @() to go along with other uses of @ throughout the language.

Even though I'm used to Perl's and Ruby's interpolation syntaxes, I immediately liked `\(…)`. It's parsimonious: Rather than taking a third character (besides \ and ") to mean something special in a string literal, it reuses one of the existing ones. There's no need to escape a character you wouldn't otherwise have to touch, or to think of another character as "magical" in a string. It fits nicely with the rest of the syntax, with `\` indicating a special construct and then `()` delimiting an expression, just as they do elsewhere in the language. It's an elegant solution to a problem traditionally solved inelegantly. It's very Swifty in that way.

> A shifted key, like $ or @, followed by another shifted key like (, allows for a much faster flow and they are much closer to the home keys than \ which is nearly as far from home keys as possible (and awkward).

I don't have any trouble typing it personally. If you find yourself accidentally typing `\9` or `|(`, we could probably offer an error for the former or warning for the latter with a fix-it. But if you're complaining that it takes a tiny fraction of a second longer to type than `$(` would, then honestly, I just can't bring myself to care. Swift optimizes for code reading. If we wanted to optimize for code typing instead, we'd have a very different style.

--
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Maybe this is flawed, but I think it is hard to argue that the \ is
easy to type when there are far more usable alternatives.

While I agree with you, readability is *so* much more important than
typeability that I think this line of argument doesn't count for much.

I agree. As a user of a German keyboard, "\" is written as Alt-Shift-7 (there isn't even a label on the keyboard, you just have to know this. The "7" key says "7" and "/" - I'm talking about the German Mac Keyboard, the standalone version of the Mac Mini and the Notebook Version of Macbook Air/Pro are the same in this regard.), and "$" is written as Shift-4. "$" is used in languages were "$" is used as a sigil for variables. It makes sense there to allow these variables directly in some strings. But not so in Swift. What I like about "\" is that it is a compatible extension to string literals, as much as possible. Strings that were valid and sensible before are still valid and sensible and mean the same thing. You can copy&paste a C string literal into Swift, and it will have the same meaning, because C strings do not contain `\(`.

I'm already used to using Alt- and Alt-Shift combinations anyway, they are just needed everywhere. Can use them for „German typographical quotes“ (Alt-^, Alt-2), “English typographical quotes” (Alt-Shift-^, Alt-Shift-2), 2 ≤ 4 comparisons, etc. E.g. the "" are Alt-5 and Alt-6.

That said, there is a programming co-worker of mine that uses an English keyboard, because he says it's easier to write code there. That's actually something that many non-English programmers do right now.

-Michael

···

Am 22.06.2016 um 02:11 schrieb Dave Abrahams via swift-evolution <swift-evolution@swift.org>:
on Tue Jun 21 2016, Brandon Knope <swift-evolution@swift.org> wrote:

--
Dave

Also keyboards are different so one's heatmap does not match other's. \()
is perfectly fine, no need to change.

r.

···

On Wed, Jun 22, 2016 at 2:15 AM, Xiaodi Wu via swift-evolution < swift-evolution@swift.org> wrote:

<…>
I'm rather unpersuaded by this line of argument. The keyboard is only so
big; it's a stretch to say that any key is less than absolutely usable.
Moreover, \ is next the delete key, which I presume you use frequently and
find no difficulty in reaching.

I find it somewhat disturbing that we are now trying to base language design around the layout of a US English keyboard.

“\” on my keyboard (British Macbook Pro Retina) is right next to the return key. It’s also much closer to the parentheses characters than $ is and (if you assume we are going to replace parentheses with braces as was suggested upthread) right next to the brace keys.

Anyway, your heat map evidence actually negates the argument. If it was a frequently used key, it would have a hot spot of its own. It’s not (I tried it on some random samples of my own code), so that implies it is not a key that is used very often, which further implies it *should* be a little out of the way.

*The* escape character for strings is “\”. Please let’s not introduce a second one.

···

On 22 Jun 2016, at 00:08, Brandon Knope via swift-evolution <swift-evolution@swift.org> wrote:

Actually… we can go pretty scientific on this sort of thing and heat map keyboard usage to get a better picture of how “usable” this is.

I pasted a file that contains seven \’s in it and heat mapped it at https://www.patrick-wied.at/projects/heatmap-keyboard/

Even *with* several \’s throughout my source file the majority of my key presses take place much closer to the $ key than the \ key.

I think we can all argue about what is clearer or not, but I think for the majority of us, the \ key is quite inconvenient compared to the keys around where we type the most.

I also ran several of iOS 10’s sample code through the heat map and continue to get pretty similar results: the \ is much further from the hottest part of the keyboard than the ones closer to where your hand usually rests.

Maybe this is flawed, but I think it is hard to argue that the \ is easy to type when there are far more usable alternatives.

Brandon

On Jun 21, 2016, at 6:10 PM, Daniel Resnick via swift-evolution <swift-evolution@swift.org> wrote:

I also disagree for the same reasons that Gwynne and Brent mentioned: I find '\(...)' easy to read, fine to type, and consistent with other string escaping syntax.

On Tue, Jun 21, 2016 at 3:55 PM, Brent Royal-Gordon via swift-evolution <swift-evolution@swift.org> wrote:
> I find that typing \(var) is very disruptive to my typing flow. The more I code in Swift, the more I like it, but every time I'm coding and then have to hiccup while typing \ then ( causes me to be annoyed. I know, it's minor, but it isn't a key combination that flows quickly.
>
> I would much rather have $() or perhaps ${} (like Groovy lang) or perhaps @() to go along with other uses of @ throughout the language.

Even though I'm used to Perl's and Ruby's interpolation syntaxes, I immediately liked `\(…)`. It's parsimonious: Rather than taking a third character (besides \ and ") to mean something special in a string literal, it reuses one of the existing ones. There's no need to escape a character you wouldn't otherwise have to touch, or to think of another character as "magical" in a string. It fits nicely with the rest of the syntax, with `\` indicating a special construct and then `()` delimiting an expression, just as they do elsewhere in the language. It's an elegant solution to a problem traditionally solved inelegantly. It's very Swifty in that way.

> A shifted key, like $ or @, followed by another shifted key like (, allows for a much faster flow and they are much closer to the home keys than \ which is nearly as far from home keys as possible (and awkward).

I don't have any trouble typing it personally. If you find yourself accidentally typing `\9` or `|(`, we could probably offer an error for the former or warning for the latter with a fix-it. But if you're complaining that it takes a tiny fraction of a second longer to type than `$(` would, then honestly, I just can't bring myself to care. Swift optimizes for code reading. If we wanted to optimize for code typing instead, we'd have a very different style.

--
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

You know what *is* unusable though? Try finding the $ key on an international keyboard.

And that, for me, is motivation in a nutshell. Swift won't always be used on OS X, where it's easy to set up Keyboard prefs to substitute (dollar) with $.

I did a search for "which symbol keys appear on most international keyboards" but didn't get very far. Surely this is something to bring into the discussion if it exists?

-- E

How can it be unpersuasive? I can *show* you that keys that are easier to
type/reach exist for a large majority of user’s.

As I pointed out, your results are flawed because there are two keys
frequently reached for in the vicinity of \ which are excluded from your
analysis. Those keys are delete/backspace and return/enter.

I am not saying it is a good idea or not to replace \, but to pretend that
there isn’t an inconvenience there is unfair when every other part of the
language is put under a magnifying glass for the sake of grammar, newbie
friendliness, or this or that, etc...

We've discussed why it's sensible grammar; there is no argument to be made
here about whether pressing one labeled key or another is friendlier to a
beginner.

This is *measurable*…it just depends on whether it bothers people or not
enough. Most other things are based on opinion, but this *can* be based on
numbers and usability.

See above; you measured wrong...

···

On Tue, Jun 21, 2016 at 6:25 PM, Brandon Knope <bknope@me.com> wrote:

This is *something used by everyone*. The usability cost is there and it
is real. Just because “well it is easy for me to type” does not mean that
it is ideal. It also doesn’t mean that the current choice is the wrong
choice either. But it still is important to discuss while we can.

And yes a keyboard IS only so big, but the range to that bigness can be
pretty… big.

Also, $ is not the only option. There are still far easier keys to type
than \.
Brandon

On Jun 21, 2016, at 7:15 PM, Xiaodi Wu <xiaodi.wu@gmail.com> wrote:

On Tue, Jun 21, 2016 at 6:08 PM, Brandon Knope via swift-evolution < > swift-evolution@swift.org> wrote:

Actually… we can go pretty scientific on this sort of thing and heat map
keyboard usage to get a better picture of how “usable” this is.

I pasted a file that contains seven \’s in it and heat mapped it at
Keyboard Heatmap | Realtime heatmap visualization of text character distribution

Even *with* several \’s throughout my source file the majority of my key
presses take place much closer to the $ key than the \ key.

I think we can all argue about what is clearer or not, but I think for
the majority of us, the \ key is quite inconvenient compared to the keys
around where we type the most.

I also ran several of iOS 10’s sample code through the heat map and
continue to get pretty similar results: the \ is much further from the
hottest part of the keyboard than the ones closer to where your hand
usually rests.

Maybe this is flawed, but I think it is hard to argue that the \ is easy
to type when there are far more usable alternatives.

I'm rather unpersuaded by this line of argument. The keyboard is only so
big; it's a stretch to say that any key is less than absolutely usable.
Moreover, \ is next the delete key, which I presume you use frequently and
find no difficulty in reaching.

You know what *is* unusable though? Try finding the $ key on an
international keyboard.

Brandon

On Jun 21, 2016, at 6:10 PM, Daniel Resnick via swift-evolution < >> swift-evolution@swift.org> wrote:

I also disagree for the same reasons that Gwynne and Brent mentioned: I
find '\(...)' easy to read, fine to type, and consistent with other string
escaping syntax.

On Tue, Jun 21, 2016 at 3:55 PM, Brent Royal-Gordon via swift-evolution < >> swift-evolution@swift.org> wrote:

> I find that typing \(var) is very disruptive to my typing flow. The
more I code in Swift, the more I like it, but every time I'm coding and
then have to hiccup while typing \ then ( causes me to be annoyed. I know,
it's minor, but it isn't a key combination that flows quickly.
>
> I would much rather have $() or perhaps ${} (like Groovy lang) or
perhaps @() to go along with other uses of @ throughout the language.

Even though I'm used to Perl's and Ruby's interpolation syntaxes, I
immediately liked `\(…)`. It's parsimonious: Rather than taking a third
character (besides \ and ") to mean something special in a string literal,
it reuses one of the existing ones. There's no need to escape a character
you wouldn't otherwise have to touch, or to think of another character as
"magical" in a string. It fits nicely with the rest of the syntax, with `\`
indicating a special construct and then `()` delimiting an expression, just
as they do elsewhere in the language. It's an elegant solution to a problem
traditionally solved inelegantly. It's very Swifty in that way.

> A shifted key, like $ or @, followed by another shifted key like (,
allows for a much faster flow and they are much closer to the home keys
than \ which is nearly as far from home keys as possible (and awkward).

I don't have any trouble typing it personally. If you find yourself
accidentally typing `\9` or `|(`, we could probably offer an error for the
former or warning for the latter with a fix-it. But if you're complaining
that it takes a tiny fraction of a second longer to type than `$(` would,
then honestly, I just can't bring myself to care. Swift optimizes for code
reading. If we wanted to optimize for code typing instead, we'd have a very
different style.

--
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

(Whoops, reply to list; also adding a reply.)

How can it be unpersuasive? I can *show* you that keys that are easier
to type/reach exist for a large majority of user’s.

As I pointed out, your results are flawed because there are two keys
frequently reached for in the vicinity of \ which are excluded from your
analysis. Those keys are delete/backspace and return/enter.

True, however, both of those keys (delete/backspace and return/enter) are
over-sized for the specific reasons that they are difficult to hit in that
position and we use them a lot so we compensate by making them larger.

If you google some pictures of typewriter keyboards, you'll see that the
backspace key was once the same size as all other keys (whereas the shift
keys and space bar were not). Moreover, if you check out international
keyboards, you'll find that several of these keys vary in size based on
country, so clearly their specific size is not considered to be very
important (even though (I presume) people delete things and advance lines
at similar frequencies regardless of language). So I don't really buy the
idea that these keys are sized "for the specific reason that they are
difficult to hit."

I am not saying it is a good idea or not to replace \, but to pretend that

there isn’t an inconvenience there is unfair when every other part of the
language is put under a magnifying glass for the sake of grammar, newbie
friendliness, or this or that, etc...

We've discussed why it's sensible grammar; there is no argument to be
made here about whether pressing one labeled key or another is friendlier
to a beginner.

The idea that \ is already a special character inside strings isn't a
valid argument for it being the -best- choice, it's simply an argument for
it being the -easiest to code for- in the compiler. Backslashes in strings
are used for special characters like \n, but I don't know of any language,
other than Swift, that uses them for variable interpolation.

So, if we're also talking about being friendlier to a beginner, I think
that using blackslash is a disservice to them because it teaches them a
pattern that isn't used by any other language for intra-string variable
interpolation.

Gwynne's argument here was persuasive to me, which is that each major
C-family language takes a different approach to interpolation. There is no
symbol which can be said to be widely used. Which is not to say that there
aren't poor choices and better ones.

···

On Tue, Jun 21, 2016 at 6:55 PM, Kenny Wyland <specialk@gmail.com> wrote:

On Tue, Jun 21, 2016 at 4:40 PM, Xiaodi Wu via swift-evolution < > swift-evolution@swift.org> wrote:

On Tue, Jun 21, 2016 at 6:25 PM, Brandon Knope <bknope@me.com> wrote:

Kenny Wyland

This is *measurable*…it just depends on whether it bothers people or
not enough. Most other things are based on opinion, but this *can* be based
on numbers and usability.

See above; you measured wrong...

This is *something used by everyone*. The usability cost is there and
it is real. Just because “well it is easy for me to type” does not mean
that it is ideal. It also doesn’t mean that the current choice is the wrong
choice either. But it still is important to discuss while we can.

And yes a keyboard IS only so big, but the range to that bigness can be
pretty… big.

Also, $ is not the only option. There are still far easier keys to type
than \.
Brandon

On Jun 21, 2016, at 7:15 PM, Xiaodi Wu <xiaodi.wu@gmail.com> wrote:

On Tue, Jun 21, 2016 at 6:08 PM, Brandon Knope via swift-evolution < >>> swift-evolution@swift.org> wrote:

Actually… we can go pretty scientific on this sort of thing and heat
map keyboard usage to get a better picture of how “usable” this is.

I pasted a file that contains seven \’s in it and heat mapped it at
Keyboard Heatmap | Realtime heatmap visualization of text character distribution

Even *with* several \’s throughout my source file the majority of my
key presses take place much closer to the $ key than the \ key.

I think we can all argue about what is clearer or not, but I think for
the majority of us, the \ key is quite inconvenient compared to the keys
around where we type the most.

I also ran several of iOS 10’s sample code through the heat map and
continue to get pretty similar results: the \ is much further from the
hottest part of the keyboard than the ones closer to where your hand
usually rests.

Maybe this is flawed, but I think it is hard to argue that the \ is
easy to type when there are far more usable alternatives.

I'm rather unpersuaded by this line of argument. The keyboard is only so
big; it's a stretch to say that any key is less than absolutely usable.
Moreover, \ is next the delete key, which I presume you use frequently and
find no difficulty in reaching.

You know what *is* unusable though? Try finding the $ key on an
international keyboard.

Brandon

On Jun 21, 2016, at 6:10 PM, Daniel Resnick via swift-evolution < >>>> swift-evolution@swift.org> wrote:

I also disagree for the same reasons that Gwynne and Brent mentioned: I
find '\(...)' easy to read, fine to type, and consistent with other string
escaping syntax.

On Tue, Jun 21, 2016 at 3:55 PM, Brent Royal-Gordon via swift-evolution >>>> <swift-evolution@swift.org> wrote:

> I find that typing \(var) is very disruptive to my typing flow. The
more I code in Swift, the more I like it, but every time I'm coding and
then have to hiccup while typing \ then ( causes me to be annoyed. I know,
it's minor, but it isn't a key combination that flows quickly.
>
> I would much rather have $() or perhaps ${} (like Groovy lang) or
perhaps @() to go along with other uses of @ throughout the language.

Even though I'm used to Perl's and Ruby's interpolation syntaxes, I
immediately liked `\(…)`. It's parsimonious: Rather than taking a third
character (besides \ and ") to mean something special in a string literal,
it reuses one of the existing ones. There's no need to escape a character
you wouldn't otherwise have to touch, or to think of another character as
"magical" in a string. It fits nicely with the rest of the syntax, with `\`
indicating a special construct and then `()` delimiting an expression, just
as they do elsewhere in the language. It's an elegant solution to a problem
traditionally solved inelegantly. It's very Swifty in that way.

> A shifted key, like $ or @, followed by another shifted key like (,
allows for a much faster flow and they are much closer to the home keys
than \ which is nearly as far from home keys as possible (and awkward).

I don't have any trouble typing it personally. If you find yourself
accidentally typing `\9` or `|(`, we could probably offer an error for the
former or warning for the latter with a fix-it. But if you're complaining
that it takes a tiny fraction of a second longer to type than `$(` would,
then honestly, I just can't bring myself to care. Swift optimizes for code
reading. If we wanted to optimize for code typing instead, we'd have a very
different style.

--
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

(Whoops, reply to list; also adding a reply.)

How can it be unpersuasive? I can *show* you that keys that are easier
to type/reach exist for a large majority of user’s.

As I pointed out, your results are flawed because there are two keys
frequently reached for in the vicinity of \ which are excluded from your
analysis. Those keys are delete/backspace and return/enter.

True, however, both of those keys (delete/backspace and return/enter)
are over-sized for the specific reasons that they are difficult to hit in
that position and we use them a lot so we compensate by making them larger.

If you google some pictures of typewriter keyboards, you'll see that the
backspace key was once the same size as all other keys (whereas the shift
keys and space bar were not). Moreover, if you check out international
keyboards, you'll find that several of these keys vary in size based on
country, so clearly their specific size is not considered to be very
important (even though (I presume) people delete things and advance lines
at similar frequencies regardless of language). So I don't really buy the
idea that these keys are sized "for the specific reason that they are
difficult to hit."

International support and ease of use is certainly important, but I'm not
sure how old typewriter keyboards are any sort of valid data point in the
discussion.

Well, given that hand sizes haven't really changed, it's an entirely valid
data point with respect to your assertion that certain parts of the
keyboard are difficult to hit. In fact, I'd argue it's probably one of the
better data points. Our keyboard layouts today are constrained in part by
habit and tradition, and what's more, we're more numb now to how learnable
typing really is because the skill is now so commonplace. But given a blank
slate, and with ample concern about the learning curve, our forbears could
make the keys almost any size they wished--and they chose a small backspace
key.

···

On Tue, Jun 21, 2016 at 7:10 PM, Kenny Wyland <specialk@gmail.com> wrote:

On Tue, Jun 21, 2016 at 5:07 PM, Xiaodi Wu <xiaodi.wu@gmail.com> wrote:

On Tue, Jun 21, 2016 at 6:55 PM, Kenny Wyland <specialk@gmail.com> wrote:

On Tue, Jun 21, 2016 at 4:40 PM, Xiaodi Wu via swift-evolution < >>> swift-evolution@swift.org> wrote:

On Tue, Jun 21, 2016 at 6:25 PM, Brandon Knope <bknope@me.com> wrote:

Kenny

Unfortunately I know nothing about international keyboards.

But surely someone could heat map their international keyboards?

I don't want to take this to ridiculous levels, but I hope I am making somewhat of a point here. Maybe not =/

Brandon

···

Sent from my iPad

On Jun 21, 2016, at 7:38 PM, Erica Sadun <erica@ericasadun.com> wrote:

You know what *is* unusable though? Try finding the $ key on an international keyboard.

And that, for me, is motivation in a nutshell. Swift won't always be used on OS X, where it's easy to set up Keyboard prefs to substitute (dollar) with $.

I did a search for "which symbol keys appear on most international keyboards" but didn't get very far. Surely this is something to bring into the discussion if it exists?

-- E

(Whoops, reply to list; also adding a reply.)

How can it be unpersuasive? I can *show* you that keys that are easier to type/reach exist for a large majority of user’s.

As I pointed out, your results are flawed because there are two keys frequently reached for in the vicinity of \ which are excluded from your analysis. Those keys are delete/backspace and return/enter.

True, however, both of those keys (delete/backspace and return/enter) are over-sized for the specific reasons that they are difficult to hit in that position and we use them a lot so we compensate by making them larger.

If you google some pictures of typewriter keyboards, you'll see that the backspace key was once the same size as all other keys (whereas the shift keys and space bar were not). Moreover, if you check out international keyboards, you'll find that several of these keys vary in size based on country, so clearly their specific size is not considered to be very important

Are you surprised that usability isn't taken into consideration for a lot of products?

Brandon

···

Sent from my iPad

On Jun 21, 2016, at 8:07 PM, Xiaodi Wu via swift-evolution <swift-evolution@swift.org> wrote:
On Tue, Jun 21, 2016 at 6:55 PM, Kenny Wyland <specialk@gmail.com> wrote:

On Tue, Jun 21, 2016 at 4:40 PM, Xiaodi Wu via swift-evolution <swift-evolution@swift.org> wrote:

On Tue, Jun 21, 2016 at 6:25 PM, Brandon Knope <bknope@me.com> wrote:

(even though (I presume) people delete things and advance lines at similar frequencies regardless of language). So I don't really buy the idea that these keys are sized "for the specific reason that they are difficult to hit."

I am not saying it is a good idea or not to replace \, but to pretend that there isn’t an inconvenience there is unfair when every other part of the language is put under a magnifying glass for the sake of grammar, newbie friendliness, or this or that, etc...

We've discussed why it's sensible grammar; there is no argument to be made here about whether pressing one labeled key or another is friendlier to a beginner.

The idea that \ is already a special character inside strings isn't a valid argument for it being the -best- choice, it's simply an argument for it being the -easiest to code for- in the compiler. Backslashes in strings are used for special characters like \n, but I don't know of any language, other than Swift, that uses them for variable interpolation.

So, if we're also talking about being friendlier to a beginner, I think that using blackslash is a disservice to them because it teaches them a pattern that isn't used by any other language for intra-string variable interpolation.

Gwynne's argument here was persuasive to me, which is that each major C-family language takes a different approach to interpolation. There is no symbol which can be said to be widely used. Which is not to say that there aren't poor choices and better ones.

Kenny Wyland

This is measurable…it just depends on whether it bothers people or not enough. Most other things are based on opinion, but this *can* be based on numbers and usability.

See above; you measured wrong...

This is something used by everyone. The usability cost is there and it is real. Just because “well it is easy for me to type” does not mean that it is ideal. It also doesn’t mean that the current choice is the wrong choice either. But it still is important to discuss while we can.

And yes a keyboard IS only so big, but the range to that bigness can be pretty… big.

Also, $ is not the only option. There are still far easier keys to type than \.
Brandon

On Jun 21, 2016, at 7:15 PM, Xiaodi Wu <xiaodi.wu@gmail.com> wrote:

On Tue, Jun 21, 2016 at 6:08 PM, Brandon Knope via swift-evolution <swift-evolution@swift.org> wrote:
Actually… we can go pretty scientific on this sort of thing and heat map keyboard usage to get a better picture of how “usable” this is.

I pasted a file that contains seven \’s in it and heat mapped it at https://www.patrick-wied.at/projects/heatmap-keyboard/

Even *with* several \’s throughout my source file the majority of my key presses take place much closer to the $ key than the \ key.

I think we can all argue about what is clearer or not, but I think for the majority of us, the \ key is quite inconvenient compared to the keys around where we type the most.

I also ran several of iOS 10’s sample code through the heat map and continue to get pretty similar results: the \ is much further from the hottest part of the keyboard than the ones closer to where your hand usually rests.

Maybe this is flawed, but I think it is hard to argue that the \ is easy to type when there are far more usable alternatives.

I'm rather unpersuaded by this line of argument. The keyboard is only so big; it's a stretch to say that any key is less than absolutely usable. Moreover, \ is next the delete key, which I presume you use frequently and find no difficulty in reaching.

You know what *is* unusable though? Try finding the $ key on an international keyboard.

Brandon

On Jun 21, 2016, at 6:10 PM, Daniel Resnick via swift-evolution <swift-evolution@swift.org> wrote:

I also disagree for the same reasons that Gwynne and Brent mentioned: I find '\(...)' easy to read, fine to type, and consistent with other string escaping syntax.

On Tue, Jun 21, 2016 at 3:55 PM, Brent Royal-Gordon via swift-evolution <swift-evolution@swift.org> wrote:
> I find that typing \(var) is very disruptive to my typing flow. The more I code in Swift, the more I like it, but every time I'm coding and then have to hiccup while typing \ then ( causes me to be annoyed. I know, it's minor, but it isn't a key combination that flows quickly.
>
> I would much rather have $() or perhaps ${} (like Groovy lang) or perhaps @() to go along with other uses of @ throughout the language.

Even though I'm used to Perl's and Ruby's interpolation syntaxes, I immediately liked `\(…)`. It's parsimonious: Rather than taking a third character (besides \ and ") to mean something special in a string literal, it reuses one of the existing ones. There's no need to escape a character you wouldn't otherwise have to touch, or to think of another character as "magical" in a string. It fits nicely with the rest of the syntax, with `\` indicating a special construct and then `()` delimiting an expression, just as they do elsewhere in the language. It's an elegant solution to a problem traditionally solved inelegantly. It's very Swifty in that way.

> A shifted key, like $ or @, followed by another shifted key like (, allows for a much faster flow and they are much closer to the home keys than \ which is nearly as far from home keys as possible (and awkward).

I don't have any trouble typing it personally. If you find yourself accidentally typing `\9` or `|(`, we could probably offer an error for the former or warning for the latter with a fix-it. But if you're complaining that it takes a tiny fraction of a second longer to type than `$(` would, then honestly, I just can't bring myself to care. Swift optimizes for code reading. If we wanted to optimize for code typing instead, we'd have a very different style.

--
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

I think that introducing another escape character is not a good idea.
\() is consistent with \r \n etc.

And I'm not sure if $ is easier to type. '\' is a single keypress and is located
near Backspace & Enter.

$ is SHIFT+4 and is harder to type without looking at the keyboard.

Andrey

···

On 22 Jun 2016, at 02:25, Brandon Knope via swift-evolution <swift-evolution@swift.org> wrote:

How can it be unpersuasive? I can *show* you that keys that are easier to type/reach exist for a large majority of user’s.

I am not saying it is a good idea or not to replace \, but to pretend that there isn’t an inconvenience there is unfair when every other part of the language is put under a magnifying glass for the sake of grammar, newbie friendliness, or this or that, etc...

This is measurable…it just depends on whether it bothers people or not enough. Most other things are based on opinion, but this *can* be based on numbers and usability.
This is something used by everyone. The usability cost is there and it is real. Just because “well it is easy for me to type” does not mean that it is ideal. It also doesn’t mean that the current choice is the wrong choice either. But it still is important to discuss while we can.

And yes a keyboard IS only so big, but the range to that bigness can be pretty… big.

Also, $ is not the only option. There are still far easier keys to type than \.

Brandon

On Jun 21, 2016, at 7:15 PM, Xiaodi Wu <xiaodi.wu@gmail.com <mailto:xiaodi.wu@gmail.com>> wrote:

On Tue, Jun 21, 2016 at 6:08 PM, Brandon Knope via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
Actually… we can go pretty scientific on this sort of thing and heat map keyboard usage to get a better picture of how “usable” this is.

I pasted a file that contains seven \’s in it and heat mapped it at Keyboard Heatmap | Realtime heatmap visualization of text character distribution

Even *with* several \’s throughout my source file the majority of my key presses take place much closer to the $ key than the \ key.

I think we can all argue about what is clearer or not, but I think for the majority of us, the \ key is quite inconvenient compared to the keys around where we type the most.

I also ran several of iOS 10’s sample code through the heat map and continue to get pretty similar results: the \ is much further from the hottest part of the keyboard than the ones closer to where your hand usually rests.

Maybe this is flawed, but I think it is hard to argue that the \ is easy to type when there are far more usable alternatives.

I'm rather unpersuaded by this line of argument. The keyboard is only so big; it's a stretch to say that any key is less than absolutely usable. Moreover, \ is next the delete key, which I presume you use frequently and find no difficulty in reaching.

You know what *is* unusable though? Try finding the $ key on an international keyboard.

Brandon

On Jun 21, 2016, at 6:10 PM, Daniel Resnick via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I also disagree for the same reasons that Gwynne and Brent mentioned: I find '\(...)' easy to read, fine to type, and consistent with other string escaping syntax.

On Tue, Jun 21, 2016 at 3:55 PM, Brent Royal-Gordon via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
> I find that typing \(var) is very disruptive to my typing flow. The more I code in Swift, the more I like it, but every time I'm coding and then have to hiccup while typing \ then ( causes me to be annoyed. I know, it's minor, but it isn't a key combination that flows quickly.
>
> I would much rather have $() or perhaps ${} (like Groovy lang) or perhaps @() to go along with other uses of @ throughout the language.

Even though I'm used to Perl's and Ruby's interpolation syntaxes, I immediately liked `\(…)`. It's parsimonious: Rather than taking a third character (besides \ and ") to mean something special in a string literal, it reuses one of the existing ones. There's no need to escape a character you wouldn't otherwise have to touch, or to think of another character as "magical" in a string. It fits nicely with the rest of the syntax, with `\` indicating a special construct and then `()` delimiting an expression, just as they do elsewhere in the language. It's an elegant solution to a problem traditionally solved inelegantly. It's very Swifty in that way.

> A shifted key, like $ or @, followed by another shifted key like (, allows for a much faster flow and they are much closer to the home keys than \ which is nearly as far from home keys as possible (and awkward).

I don't have any trouble typing it personally. If you find yourself accidentally typing `\9` or `|(`, we could probably offer an error for the former or warning for the latter with a fix-it. But if you're complaining that it takes a tiny fraction of a second longer to type than `$(` would, then honestly, I just can't bring myself to care. Swift optimizes for code reading. If we wanted to optimize for code typing instead, we'd have a very different style.

--
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

There are many handy utilities for string-snippet replacement. For
example, TextExpander can be configure to replace \\ with \(), putting
the insertion point between the parens. I'm sure people can come up with
other solutions to suit their workflow, if typing it straight out is
uncomfortable.

I don't think a language should be optimised for typing but for reading
and logical consistency.

-Nick
(This is my first post to the list. but I have been reading it for a
long time.)

···

On Wed, Jun 22, 2016, at 09:44 AM, Rimantas Liubertas via swift-evolution wrote:

On Wed, Jun 22, 2016 at 2:15 AM, Xiaodi Wu via swift-evolution <swift- > evolution@swift.org> wrote:

<…>

I'm rather unpersuaded by this line of argument. The keyboard is only
so big; it's a stretch to say that any key is less than absolutely
usable. Moreover, \ is next the delete key, which I presume you use
frequently and find no difficulty in reaching.

Also keyboards are different so one's heatmap does not match other's.
\() is perfectly fine, no need to change.

r.
_________________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

I agree. As a user of a German keyboard, "\" is written as Alt-Shift-7 (there isn't even a label on the keyboard, you just have to know this. The "7" key says "7" and "/" - I'm talking about the German Mac Keyboard, the standalone version of the Mac Mini and the Notebook Version of Macbook Air/Pro are the same in this regard.), and "$" is written as Shift-4. "$" is used in languages were "$" is used as a sigil for variables. It makes sense there to allow these variables directly in some strings. But not so in Swift. What I like about "\" is that it is a compatible extension to string literals, as much as possible. Strings that were valid and sensible before are still valid and sensible and mean the same thing. You can copy&paste a C string literal into Swift, and it will have the same meaning, because C strings do not contain `\(`.

I'm already used to using Alt- and Alt-Shift combinations anyway, they are just needed everywhere. Can use them for „German typographical quotes“ (Alt-^, Alt-2), “English typographical quotes” (Alt-Shift-^, Alt-Shift-2), 2 ≤ 4 comparisons, etc. E.g. the "" are Alt-5 and Alt-6.

That said, there is a programming co-worker of mine that uses an English keyboard, because he says it's easier to write code there. That's actually something that many non-English programmers do right now.

Exactly. And on some other keyboards, $ is not easily accessible either. There will never be a universal character that's easily accessible on all keyboards. \ is already used for escaping characters in a string, which makes it logical.

···

-Michael

--
Dave

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution