News for hackers. Stuff that matters.
Re:Fun with Unicode in Swift by adwn on Saturday December 15, 2018 @10:32AM (#18688695)
>> 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.

Re:Fun with Unicode in Swift by chrisseaton on Saturday December 15, 2018 @10:42AM (#18688749)
> 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.

Re:Fun with Unicode in Swift by adwn on Saturday December 15, 2018 @10:56AM (#18688837)
But 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.

Re:Fun with Unicode in Swift by vbezhenar on Saturday December 15, 2018 @10:57AM (#18688842)
How do I type it with US layout on Windows?
Re:Fun with Unicode in Swift by chrisseaton on Saturday December 15, 2018 @11:44AM (#18689082)
No 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?
Re:Fun with Unicode in Swift by vbezhenar on Saturday December 15, 2018 @11:53AM (#18689116)
Because 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.
Re:Fun with Unicode in Swift by oldmanhorton on Saturday December 15, 2018 @12:20PM (#18689246)
PCs 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
Re:Fun with Unicode in Swift by vbezhenar on Saturday December 15, 2018 @04:34PM (#18690458)
I don't think that it's feasible to type source code this way.
Re:Fun with Unicode in Swift by ubernostrum on Saturday December 15, 2018 @09:10PM (#18691390)
I 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.