3 ms·
Wow... seems like a nightmare for several reasons: >Naming Constants and Variables >You can use almost any character you like for constant and >variable name
by Alupis 12y ago
Wow... seems like a nightmare for several reasons:
>Naming Constants and Variables
>You can use almost any character you like for constant and
>variable names, including Unicode characters:
>let π = 3.14159
>let 你好 = "你好世界"
>let 🐶🐮 = "dogcow"
https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html#//apple_ref/doc/uid/TP40014097-CH5-XID_399 https://developer.apple.com/library/prerelease/ios/documenta...
- tailrecursion 12y agoI think if you're going to make a strong criticism of a complete design and implementation that includes decisions that were almost certainly made deliberately, then you owe an explanation or some kind of argument. My position is that it's the language's job to allow expression of ideas and not its job to police or disallow bad sentences. I think such a thing [EDIT: disallowing bad sentences] is impossible and leads to COBOL-like languages. (Compilers can have options for coding standards, like "house rules" but I don't think it's the language's role.)
- Alupis 12y agoWell, besides adding to complexity of debugging or just reading/understanding of the codebase when the dev may not be familiar with say.. .Chinese characters, it may also limit which platforms it can run on. But, this is an apple language targeting only apple devices so the last part isn't much of an issue. Basically using unicode characters is comparable to purposeful obfuscation, are difficult to type (no keyboard i'm aware of has a "cow" key), difficult to read/remember, and may become wrongly converted if the code is copy/pasted into a text editor not supporting that character. Now, I don't think this constituted as a "strong criticism" nor warranted the downvote nor the expletive.
- ryanwhitney 12y agoI don't think that is what "several" means.
- Alupis 12y agoI was not commenting on the entire languages design... talk about jumping to conclusions lol.