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…
CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter
121–130 of 188 posts
Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter
#122At 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_...
Of course, this is kind of co-opting the call stack to build up at runtime what the compiler can already provide as an AST, so it might be better to just use a macro.
This representation can't be serialized quite as easily as a single symbol or whatever Apple is doing, but it is infinitely flexible. And it seems like a code smell to me that they have a special case for the father's brother, while the mother only has a generic "sibling." It should be up to the view layer to determine that kind of localization-specific logic. If you just store a completely arbitrary relation then you can punt it to the localization to decide how to translate that into meatspeak.
Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter
#123I 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.)
Ours is pretty simple, I imagine this system is intended to cover Chinese kinship which is _really_ complex. https://en.m.wikipedia.org/wiki/Chinese_kinship#Common_exten...
Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter
#124I 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.)
We do have quite a few words in Lithuanian (e.g. for maternal/paternal branches and more detailed words for "X in law"). But it was getting simplified in the past few decades. I've heard quite a few words that I couldn't describe without looking at the dictionary.
Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter
#125At 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_...
A pretty idiomatic (and trivial to implement) Scala way of doing this would be to have a DSL with a name for each relation and compose them together using function application. So to express "MothersSiblingsDaughter" you'd write "mother sibling daughter". The whole expression would return an object which contains a linked list of the individual components, consed together by each individual function application in th…
Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter
#126At 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_...
You need an intermediate representation (like a tree) rather than attempt to brute force every possible permutation up until some arbitrary point. Even if that weren't the case, it'd be better to give it a more obscure name or create some kind of naming system and then document it rather than demonstrate why self-documenting code can become self-defeating if taken to an extreme.
Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter
#127I 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.)
For aunts its faster/moster (portmanteau of father-sister, mother-sister, roughly). For uncles its farbror/morbror (lit. father-brother, mother-brother).
For grandparents its farfar/morfar (father-father, mother-father) and farmor/mormor (father-mother, mother-mother).
A great grandparent could be e.g. a farfarsfar, or father-fathers-father.
Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter
#128I 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.)
On the other hand, it has different words for "wife's mother" and "husband's mother", which in English are both "mother-in-law". Similar for the "father-in-law" relationship: different words for "wife's father" and "husband's father". Similar for sibling-in-law relationships.
(Of course there's the open question of whether Russian would count as "East" or "West".)
Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter
#129Your younger cousin sister, either from one of your mother's brothers and sisters, or from one of your father's sisters.
Or two characters in Chinese: 表妹(BiaoMei). If she is from one of your father's brothers, she's your 堂妹(TangMei). The latter is regarded as being closer because you share the same family name, but nowadays it just doesn't matter any more.
Some of the other commenters think it's 表姐. No matter who is right, you see, the long name bears no clear meaning even for Chinese.
Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter
#130Earlier quoted context omitted.
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?