<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br><br>Sent from my iPad</div><div><br>On Jun 21, 2016, at 8:07 PM, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div>(Whoops, reply to list; also adding a reply.)</div><div><br></div>On Tue, Jun 21, 2016 at 6:55 PM, Kenny Wyland <span dir="ltr">&lt;<a href="mailto:specialk@gmail.com" target="_blank">specialk@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Tue, Jun 21, 2016 at 4:40 PM, Xiaodi Wu via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><span>On Tue, Jun 21, 2016 at 6:25 PM, Brandon Knope <span dir="ltr">&lt;<a href="mailto:bknope@me.com" target="_blank">bknope@me.com</a>&gt;</span> wrote:<br></span><div class="gmail_extra"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">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.</div></blockquote><div><br></div></span><div>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.</div></div></div></div></blockquote><div><br></div></span><div>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.&nbsp;</div></div></div></div></blockquote><div><br></div><div>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</div></div></div></div></div></blockquote><div><br></div><div>Are you surprised that usability isn't taken into consideration for a lot of products?</div><div><br></div><div>Brandon</div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> (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."</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>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...</div><div><br></div><div></div></div></blockquote><div><br></div></span><div>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.</div></div></div></div></blockquote><div><br></div></span><div>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.</div><div><br></div><div>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.</div></div></div></div></blockquote><div><br></div><div><span style="font-size:13px">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.</span></div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><font color="#888888"><div><br></div><div>Kenny Wyland<br></div></font></span><div><div class="h5"><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>This is <b>measurable</b>…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.</div></div></blockquote><div><br></div></span><div>See above; you measured wrong...</div><div><div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>This is <b>something used by everyone</b>. 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.</div><div><br></div><div>And yes a keyboard IS only so big, but the range to that bigness can be pretty… big.</div><div><br></div><div>Also, $ is not the only option. There are still far easier keys to type than \.</div><span><font color="#888888"><div>Brandon</div></font></span><div><div><div><br><div><blockquote type="cite"><div>On Jun 21, 2016, at 7:15 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br><div><div dir="ltr">On Tue, Jun 21, 2016 at 6:08 PM, Brandon Knope via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">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.<div><br></div><div>I pasted a file that contains seven \’s in it and heat mapped it at&nbsp;<a href="https://www.patrick-wied.at/projects/heatmap-keyboard/" target="_blank">https://www.patrick-wied.at/projects/heatmap-keyboard/</a></div><div><br></div><div>Even *with* several \’s throughout my source file the majority of my key presses take place much closer to the $ key than the \ key.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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.</div></div></blockquote><div><br></div><div>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.</div><div><br></div><div>You know what *is* unusable though? Try finding the $ key on an international keyboard.</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Brandon</div><div><div><div><br><div><br></div><div><br><div><blockquote type="cite"><div>On Jun 21, 2016, at 6:10 PM, Daniel Resnick via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div><div dir="ltr">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.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 21, 2016 at 3:55 PM, Brent Royal-Gordon via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>&gt; 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.<br>
&gt;<br>
&gt; I would much rather have $() or perhaps ${} (like Groovy lang) or perhaps @() to go along with other uses of @ throughout the language.<br>
<br>
</span>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.<br>
<span><br>
&gt; 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).<br>
<br>
<br>
</span>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.<br>
<span><font color="#888888"><br>
--<br>
Brent Royal-Gordon<br>
Architechies<br>
</font></span><div><div><br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div>
_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br></div></div></div></div></div><br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div></div>
</div></blockquote></div><br></div></div></div></div></blockquote></div></div></div><br></div></div>
<br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>