Live data from Hacker News

CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

developer.apple.com

111–120 of 188 posts

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#111

At first glance this looked like a code smell, but after some reflection I can't think of a cleaner, more readable way to uniquely identify each possible relationship -- especially in a strongly-typed language with an IDE. Here's the full list: https://developer.apple.com/documentation/contacts/contacts_...

`Colleague` in `CNLabelContactRelationColleauge` is spelled incorrectly.

If you have a macOS or iOS beta installed, please report that through the Feedback app on either?

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#112
post #92
post #15

Earlier quoted context omitted.

Yup. @dang, can you fix this?

In principle yes, but I tried in 4 (edit: 5) browsers and couldn't reproduce the problem, and it's late here and I'm running out of steam. So you may have to suffer overnight. Sorry about that. Edit: ok, thanks to https://en.wikipedia.org/wiki/Unicode_character_property#Whi... I put in a bunch of ​ . I hope that fixes it because I need to sign off now. If it isn't fixed, it would be helpful if som…

It's reproducible for me when viewing the home page in Chrome 75 on Android 9 (Pixel 2 XL).

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#113

At first glance this looked like a code smell, but after some reflection I can't think of a cleaner, more readable way to uniquely identify each possible relationship -- especially in a strongly-typed language with an IDE. Here's the full list: https://developer.apple.com/documentation/contacts/contacts_...

I still don’t think this is a good solution because of the common CNLabelContactRelation prefix. It would be better to introduce a CNLabelContactRelation enum? Then the enum cases would be much less painful. Or at least an empty enum as a namespace:

  enum CNLabelContactRelation {
    static let aunt = "…"
    static let auntFathersBrothersWife = "…"
  }

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#114

That label is so long it’s breaking the HN front page layout for me on mobile.

I've attempted to fix it. Details at https://news.ycombinator.com/item?id=20352144.

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#115
post #19

Earlier quoted context omitted.

Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz 1: https://de.m.wikipedia.org/wiki/Rindfleischetikettierungs%C3... - check out the voice version!

You've got to love the "abbreviations" for these laws. RflEttÜAÜG

I like that better than the American way of inventing stupid names, so that the acronym is "cute".

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#116
post #32
post #6

表姐, in case you were wondering.

Exactly... Could it not just have been named CNContactLabelRelation表姐 ?

In case you're serious I'd have to rely on IDE completion or copy/paste to input this, not being familiar with chinese input methods. It would also make it trickier to compare identifiers and make sure that it makes sense.

I think it makes more sense to keep all identifiers in English or alternatively provide completely localized versions of the API in other languages, going halfway is just going to confuse everybody. Remember for instance the confusion created by PHP using hebrew in the symbol for the '::' operator: https://stackoverflow.com/questions/592322/php-expects-t-paa...

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#117
post #48

Earlier quoted context omitted.

Is Chinese the only language with this relationship? Also, identifiers in Apple frameworks are always ASCII.

They could have used Pinyin. Even people who don’t speak Chinese and have to look it up would have an easier time understanding it than trying to parse this identifier.

And then every time you re-read the code you have to look it up to understand 1/ what the hell is even this and 2/ is it the right one at the right place.

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#118

Earlier quoted context omitted.

`Colleague` in `CNLabelContactRelationColleauge` is spelled incorrectly.

If you have a macOS or iOS beta installed, please report that through the Feedback app on either?

Why on earth would someone do bug fixes for free for a corporation that has cash reserves of $250 billion but is too stingy to pay for quality control?

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#120

I can see why this is needed. English has very broad words for relatives like "grandfather" or "aunt". Most languages have more specific words, especially Chinese where there are separate words for fathers or mothers side, older or younger and sibling or siblings spouse. You also often use these relation words rather than their names when referring to a relatives. If this code was in Chinese, they would all be short…

Genuinely curious, but is it actually like that in most languages? I wondered if it was maybe an East/West difference, since I haven't come across that in my French & German learning, and I didn't think Dutch or Danish were like that either. But apparently Swedish does have this (eg faster/moster for paternal aunt & maternal aunt)?

(Most of my learning is via Duolingo, so I'm no expert, just curious.)

Post reply on HN