[swift-evolution] Beyond Typewriter-Styled Code in Swift, Adoption of Symbols
jprattx at gmail.com
Mon Aug 28 23:58:39 CDT 2017
I think the editor would recognize that "<==“ was just
typed and replace it with the unicode character ≤ immediately.
Likewise, x^2 would be recognized and turned into x with 2 in superscript.
As for how the UI would work for other types of symbols,
there are all kinds of techniques for that. That is a UI issue,
for a UI design team to address. XCode’s code completion is just one
example of how UI can manage input issues.
> On Aug 28, 2017, at 11:43 PM, Charlie Monroe <charlie at charliemonroe.net> wrote:
>> On Aug 29, 2017, at 4:57 AM, John Pratt via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> I sent a postal envelope to the Swift team with an article I wrote, arguing that
>> symbols and graphics would push the programming language forward.
>> Wouldn’t it be nice to have an actual multiplication matrix broken out into code,
>> instead of typing, “matrix()”? It seems to me Swift has the chance to do that.
>> Also: why does "<==" still reside in code as "less than or equal to” when
>> there is a unicode equivalent that looks neat?
> Hi John,
> while it may be visually appealing, can you imagine typing those in real-life programming? I can't. Reaching for Symbol Viewer each time I need to compare two ints is a bit impractical, don't you think? Yes, on some keyboard layouts (e.g. US), you can use Option-< to type ≤, but in general, this one keyboard layout out of many and also the other symbols suggested (union, etc.) are nowhere to be found on a keyboard.
> If you desire them, you can define custom operators, but it's IMHO impractical. It would require a radical redesign of the keyboard - and if you suggest the TouchBar, can you imagine symbols from your Fig. 6 on there and having to browse through them looking for the one you want?
> If you want to test using them, you can try this library that defines them: https://github.com/mattt/Euler <https://github.com/mattt/Euler>
>> Why can’t the square of x have a superscript of 2 instead of having “pow(x,2)?
>> I think this would make programming much easier to deal with.
> Sorry, but I personally think it would make programming slower. Person, who can type with all 10 of his fingers will outpace a person looking for math symbols on a TouchBar any time he need to use "greater than or equal"...
>> I expound on this issue in my article:
>> http://www.noctivagous.com/nct_graphics_symbols_prglngs_draft2-3-12.pdf <http://www.noctivagous.com/nct_graphics_symbols_prglngs_draft2-3-12.pdf>
>> Thank you for reading.
>> swift-evolution mailing list
>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution