3 ms·
>> Unicode in identifiers is an exceptionally bad idea > In Swift all identifiers are Unicode - basic letters are part of Unicode. Yes, and it's an exceptiona
by adwn 8y ago
>> Unicode in identifiers is an exceptionally bad idea
> In Swift all identifiers are Unicode - basic letters are part of Unicode.
Yes, and it's an exceptionally bad idea to allow non-basic letters in identifiers, as the linked article demonstrates.
>> how is a Canadian supposed to easily use it?
> Using their keyboard? Can't a Canadian type these letters in the exactly the same way as anyone else would?
No, they can't. ä, ö, ü, ß are part of the German keyboard layout QWERTZ, but they're not on a QWERTY keyboard.
- chrisseaton 8y ago> No, they can't Anyone can type them using a modifier key. I have a UK keyboard and to get ß I hold option and press s. It's no different to using the shift key. If you've got no problem with capital letters you should have no problem with these letters.
- adwn 8y agoBut then you need to learn and remember how to type those letters. There's such a big difference between capital letters, which you need and use constantly, and badly discoverable key combinations, which you need and use infrequently, that your comparison is downright disingenuous. Sometimes I boot into a machine where the keyboard layout is set to English. Finding the right keys on my non-English keyboard to even just type "ls -l /" or similar, is a major pain in the ass. It would be the same for a Canadian having to type 'ß' on an irregular basis.
- vbezhenar 8y agoHow do I type it with US layout on Windows?
- chrisseaton 8y agoNo idea - look it up? Why's it such a problem? Is it harder than looking up how to type a copyright sign when you need one of those?
- vbezhenar 8y agoBecause there's no option key on Windows and existing modifier keys do not produce anything similar. For copyright I'm using © and if I would need it outside of HTML, probably I'd google it and copy-paste from browser. You are thinking that it's easy to type those weird character for everyone, it's not easy. Probably easiest way is to use some European layout and then spending rest of year trying to remember foreign mappings which don't even correspond to printed letters on keyboard.
- oldmanhorton 8y agoPCs have “alt codes”, which is a combo of alt+numbers to represent some (most?) Unicode characters. I believe the German characters are in the alt+0250 (+-10) zone
- vbezhenar 8y agoI don't think that it's feasible to type source code this way.
- ubernostrum 8y agoI think it's useful, if you feel it's a burden to have to interoperate with a codebase using non-ASCII identifiers, to consider how literally every person in the world whose native language is non-ASCII must have felt being forced to use it for programming. Let people who have to interoperate with multilingual colleagues settle on conventions for doing so. Let people who don't use their own language already.