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.<p>Here's the full list: <a href="https://developer.apple.com/documentation/contacts/contacts_constants" rel="nofollow">https://developer.apple.com/documentation/contacts/contacts_...</a>
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 words.<p>English words like "aunt" cannot really be translated into Chinese. If you are translating a book you either try to figure out the exact relation from the context, or just pick one if it doesn't matter. In someones address book you can't do that.
“There are only two hard things in Computer Science: cache invalidation and naming things.” [1]<p>[1] <a href="https://martinfowler.com/bliki/TwoHardThings.html" rel="nofollow">https://martinfowler.com/bliki/TwoHardThings.html</a>
For a long time, the Carbon universal headers
Included a plain, non-namespaced (c header) MacTypes.h which included:<p>enum {
h = 0,
v = 1
};<p>This could lead to very confusing compiler errors... it was there for compatibility with an anonymous pascalnunion that let you treat a pascal Rect as an anonymous array of two Point structures..
Well, there's CNLabelContactRelationYoungerCousinMothersSiblingsDaughterOrFathersSistersDaughter, which is two letters longer than CNLabelContactRelationElderCousinMothersSiblingsDaughterOrFathersSistersDaughter.<p><a href="https://developer.apple.com/documentation/contacts/cnlabelcontactrelationyoungercousinmotherssiblingsdaughterorfatherssistersdaughter" rel="nofollow">https://developer.apple.com/documentation/contacts/cnlabelco...</a><p>This is my favorite topic.
I'm grateful that Apple at least prefixed this. IIRC, between iOS 11 and 12, Apple added a <i>Contact</i> class somewhere within their standard set of frameworks. I was maintaining an app that used CoreData as a store and did not have prefixed Core Data entity names. And of course it had its own <i>Contact</i> class.<p>Long story short, I started building against the newer SDK and the app started crashing in the most oblique way possible. Prefixing the entity and class name solved the problem, but I only stumbled on that through a combination of luck, intuition, and half a day of banging my head against a wall.
Why is everyone assuming this is about Chinese??? CN is the class prefix for the Contacts.framework library, like every other Apple API. For example:<p>CoreLocation: CL (CLLocation)<p>SpriteKit: SK (SKScene)<p>CloudKit: CK (CKRecord)<p>CoreVideo: CV (CVBuffer)<p>LocalAuthentication: LA (LAContext)<p>So on and so forth...
NativLang did a video about kinship systems that is relevant here: <a href="https://www.youtube.com/watch?v=YOi2c2d3_Lk" rel="nofollow">https://www.youtube.com/watch?v=YOi2c2d3_Lk</a>
A good example of poor naming. Explained:<p>Your younger cousin sister, either from one of your mother's brothers and sisters, or from one of your father's sisters.<p>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.<p>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.
Does this page have some sort of camel-case aware word breaking? As I resize the page I notice it always remains broken at a word boundary and never breaks inside a word.<p>Ok, I see it now: there are wbr tags between the words on the page. TIL.
Anybody care to introduce me to this? Why does it have to be father's sister but mother's sibling? And how does elder and younger cousins behave differently?
Java Swing took verbosity even further than that. I present to you a 92-character class name [1].<p>> InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState<p>Thankfully, I think they fixed it in the newer version.<p>[1]: <a href="https://twitter.com/peterlawrey/status/577176384520384512" rel="nofollow">https://twitter.com/peterlawrey/status/577176384520384512</a>
I guess I'm confused as to the specificity of this. Why are a paternal uncle's daughters not included? Why only elder?<p>Also curious as to why this is important enough to have a specific type of contact for?
It’s kind of nice seeing the homepage with a fixed row height per story! I guess it will not last bit that was a nice thing that came of this. Thanks, OP :)
For those using Refined Hacker News[1] for Firefox on Android, you can add this to the <i>Custom CSS</i> field to prevent the overflow:<p><pre><code> tr.athing td.title:not([valign="top"]) {
word-break: break-word;
}
</code></pre>
[1]: <a href="https://github.com/plibither8/refined-hacker-news" rel="nofollow">https://github.com/plibither8/refined-hacker-news</a>
This is a joke right? Please explain if not. Why wouldn’t you just name the variable relationship (or CNRelationship to adhere to nonsensical globals) and abstract the method for getting there to other logic?