11 ms·
CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter
- dshields1 7y agoThat label is so long it’s breaking the HN front page layout for me on mobile.
- alex_young 7y agoSame here. I notice it's truncated in the comment dialog, why not also the main page?
- mrb 7y agoHN should add the CSS rule "word-wrap:break-word". In fact this rule should almost always be the default for text that might contain excessively long words (such as user-submitted text on forums).
- lone_haxx0r 7y ago(...Or german)
- nisa 7y agoRindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz 1: https://de.m.wikipedia.org/wiki/Rindfleischetikettierungs%C3%BCberwachungsaufgaben%C3%BCbertragungsgesetz https://de.m.wikipedia.org/wiki/Rindfleischetikettierungs%C3... - check out the voice version!
- cerebellum42 7y agoYou've got to love the "abbreviations" for these laws. RflEttÜAÜG
- Tomte 7y agoI like that better than the American way of inventing stupid names, so that the acronym is "cute".
- anewhnaccount2 7y agoYou should use ­ or <wbr> between word­parts for 100% pedantically correct word breaking.
- cbsks 7y agoYup. @dang, can you fix this?
- scarcelycoher 7y agoDon't order him about. You are not his boss.
- dang 7y agoIn 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#Whitespace 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 someone would email hn@ycombinator.com so we see that in the morning. Short term memory does not survive the firehose.
- cbsks 7y agoThanks, it’s not a huge issue! I’m able to see the issue with safari on my iPhone, FYI.
- lstamour 7y agoHappened for me on iOS 13 if it helps. Font stays the normal size but you have to scroll right. If you zoom out, it’s a bit harder to read but not bad.
- babak_ap 7y agoFirefox and Firefox Focus on Android present the same issue.
- buu700 7y agoIt's reproducible for me when viewing the home page in Chrome 75 on Android 9 (Pixel 2 XL).
- 7y ago
- cortesoft 7y agoI was wondering what was going on!
- komali2 7y agoThat's why it's broken! Was so confused
- deleted 7y ago[deleted]
- smadge 7y agoSo that explains it!
- dang 7y agoI've attempted to fix it. Details at https://news.ycombinator.com/item?id=20352144 https://news.ycombinator.com/item?id=20352144.
- sjcsjc 7y agoThanks. That fixed it for me (chrome on Android)
- Redoubts 7y agoAlso broke hckrnews.com on mobile. I was wondering what was going on there.
- peapicker 7y agoWell first cousin anyway.
- rntksi 7y agoI spent 10 minutes laughing about this and the worst part is my wife asking why am I laughing and I cannot explain why
- wonderfuly 7y agoyeah, you cannot
- yorwba 7y ago表姐, in case you were wondering.
- rudiv 7y agoI'm assuming those Mandarin characters comprise the word for that relationship? I was wondering why this existed and I thought maybe they were adding the Hindi words for specific relatives (there's many, I assume the same is true for Mandarin).
- kenneth 7y agoMandarin is a spoken language. The characters are "Simplified Chinese" in this case. The characters will sound different read in different languages. e.g. the two Traditional Chinese characters 東京 translate roughly to "Eastern Capital" and are read dōngjīng, while they are also valid Japanese Kanji where they have the same meaning and are read as Tokyo. (Yes, the name of the capital of Japan.) Interestingly, Běijīng and Nánjīng similarly mean "northern" and "southern" capital respectively.
- echaozh 7y agoThere was once an Eastern Capital in China which is also named as Kaifeng, the capital of the Northen Song Dynasty. It is to east of Chang'an, which is now Xi'an, and the capital of most of earlier dynasties.
- helloviper 7y agoIn Chinese culture, your male line ancestry matter more. Your mother's family is considered auxiliary ('外家'), thus only your father's brother's children are considered in the same family, and these cousins are labeled “堂”, all the other cousins are labeled "表”, and "姐" means older sister.
- NamTaf 7y agoIs this why it is a mother's sibling of any gender, but only a father's sister?
- dmix 7y agoCan HN add wordbreaking css on mobile? This breaks the width of the page on mobile.
- mrob 7y agoLooks like a good place for some zero-width spaces. https://en.wikipedia.org/wiki/Zero-width_space https://en.wikipedia.org/wiki/Zero-width_space
- saagarjha 7y agoThose aren’t automatic, though.
- mrob 7y agoHN already supports title edits, so it's simpler than changing the CSS, and it's easier to read because the breaking is on the internal word boundaries. Here's the title with the zero-width spaces added: CN Label Contact Relation Elder Cousin Mothers Siblings Daughter Or Fathers Sisters Daughter EDIT: HN strips zero-width spaces and replaces them with normal spaces, so I can't post it here.
- asutekku 7y agoThen the title would not make sense anymore. Adding a simple css rule would also be futureproof, because i’m quite sure this is not going to be the last time an absurdly long title word appears.
- Waterluvian 7y agoIs this just one of those exceptional cases when having a strict variable naming convention doesn't work out?
- eof 7y agoSeems to be working fine.
- scarcelycoher 7y agoIf it works, don't break it
- eridius 7y agoWhat else would you name it?
- umanwizard 7y agoCNBiaoJie Still easier to understand than this monstrosity, even for those who don’t speak Chinese (assuming they can google the documentation).
- eridius 7y agoI have no idea what "BiaoJie" is (well, in context, I assume it's a romanization of the pronunciation of 表姐), so that name would be completely unhelpful. Whereas the current name describes the relationship such that I can understand it, even if I don't know why this particular relationship is deserving of a name. Something like CNBiaoJie also assumes that Chinese is the only language that names this relationship, and I don't know if that's true.
- whoevercares 7y agoIndia has the same convention and words However the CN prefix might mean you should learn a bit Pinyin or Chinese haha
- euske 7y agoWell, there's CNLabelContactRelationYoungerCousinMothersSiblingsDaughterOrFathersSistersDaughter, which is two letters longer than CNLabelContactRelationElderCousinMothersSiblingsDaughterOrFathersSistersDaughter. https://developer.apple.com/documentation/contacts/cnlabelcontactrelationyoungercousinmotherssiblingsdaughterorfatherssistersdaughter https://developer.apple.com/documentation/contacts/cnlabelco... This is my favorite topic.
- HNLurker2 7y agoWell the article draws enough attention to the cause
- dang 7y agoOk, we changed to that from https://developer.apple.com/documentation/contacts/cnlabelcontactrelationeldercousinmotherssiblingsdaughterorfatherssistersdaughter https://developer.apple.com/documentation/contacts/cnlabelco.... Thanks!
- zaroth 7y agoUpvote for breaking HN CSS on mobile.
- api 7y agoNeeds CNFathersMothersNephewsCousinsFormerRoommate
- cmroanirgo 7y agoYou missed a sibling or younger or elder in there somewhere.
- Klonoar 7y agoIt's a Spaceballs reference. :)
- SmellyGeekBoy 7y agoI see your schwartz is as big as mine!
- deleted 7y ago[deleted]
- tintintin 7y agoFor those using Refined Hacker News[1] for Firefox on Android, you can add this to the Custom CSS field to prevent the overflow: tr.athing td.title:not([valign="top"]) { word-break: break-word; } [1]: https://github.com/plibither8/refined-hacker-news https://github.com/plibither8/refined-hacker-news
- eslaught 7y agoDoes 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. Ok, I see it now: there are wbr tags between the words on the page. TIL.
- shubhamjain 7y agoJava Swing took verbosity even further than that. I present to you a 92-character class name [1]. > InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState Thankfully, I think they fixed it in the newer version. [1]: https://twitter.com/peterlawrey/status/577176384520384512 https://twitter.com/peterlawrey/status/577176384520384512
- TimTheTinker 7y agoAt 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_constants https://developer.apple.com/documentation/contacts/contacts_...
- bayonetz 7y agoAmen. Sometimes it takes what it takes to be precise.
- c3534l 7y agoYou 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.
- masklinn 7y agoThe issue of a tree is you could trivially create nonsensical relationships. An alternative would be some sort of nested attributes / tag set but even that's not excellent. A second issue is, this is probably a localisation / cultural concern: below, yorwba notes that this relationship is a specific term in chinese kinship: https://en.wikipedia.org/wiki/Chinese_kinship#Common_extended_family_and_terminology https://en.wikipedia.org/wiki/Chinese_kinship#Common_extende....
- sansnomme 7y agoAnd generate the list using metaprogramming at compile time.
- jug 7y agoNot sure, but I sort of expected this monstrosity happens because the labels are intended to be localizable.
- salgernon 7y agoFor a long time, the Carbon universal headers Included a plain, non-namespaced (c header) MacTypes.h which included: enum { h = 0, v = 1 }; 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..
- sixdimensional 7y ago“There are only two hard things in Computer Science: cache invalidation and naming things.” [1] [1] https://martinfowler.com/bliki/TwoHardThings.html https://martinfowler.com/bliki/TwoHardThings.html
- whoisthemachine 7y agoAnd off by one errors
- goatlover 7y agoIf only there were 1 based PLs.
- davidgay 7y agoThe 1st one? (It wasn't the zeroth language, which is probably why it couldn't use 0-based indexing)
- bonzini 7y agoSmalltalk arrays and strings are 1-based.
- danielparks 7y agoPerl supports this. Optionally, on a per-file basis. Because it’s Perl. https://perldoc.perl.org/perlvar.html#%24%5b https://perldoc.perl.org/perlvar.html#%24%5b
- scarejunba 7y agoLua is a famous one that defaults to 1-indexing for arrays.
- masklinn 7y agoThey don't fix off-by-one errors, just move them around.
- kalleboo 7y ago
- jeromebaek 7y agoHelp, this post is breaking Hacker News mobile because the title is too long without spaces.
- aaronbrethorst 7y agoI'm grateful that Apple at least prefixed this. IIRC, between iOS 11 and 12, Apple added a Contact 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 Contact class. 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.
- galad87 7y agoApple recommends to use at least a three character prefix in your objective-c classes to avoid collisions.
- aaronbrethorst 7y agoI am well-acquainted with Apple's recommendations. The codebase I inherited was not. Unfortunately, Apple's Core Data documentation is also not acquainted with Apple's recommendations: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreData/KeyConcepts.html https://developer.apple.com/library/archive/documentation/Co...
- mraison 7y agoThere’s also CNLabelContactRelationColleauge. Oops :) https://developer.apple.com/documentation/contacts/cnlabelcontactrelationcolleauge https://developer.apple.com/documentation/contacts/cnlabelco...
- pgb 7y agoSpalling mistek
- microwavecamera 7y agoSo out of curiosity I Googled it. Either it's a really common mistake or a regional thing. "Colleauge" has 857k results. https://www.google.com/search?q=%22colleauge%22 https://www.google.com/search?q=%22colleauge%22
- shaggyfrog 7y agoNativLang did a video about kinship systems that is relevant here: https://www.youtube.com/watch?v=YOi2c2d3_Lk https://www.youtube.com/watch?v=YOi2c2d3_Lk
- ridiculous_fish 7y agoWinforms has some gems: DataGridViewColumnDividerDoubleClickEventArgs ListViewVirtualItemsSelectionRangeChangedEventHandler
- rimliu 7y agoThere is also this classic: https://github.com/mattl/opensource.apple.com/blob/88cbaab4a42e97cbbfe6b660f2f0945536821be6/src/system_cmds/system_cmds-735/shutdown.tproj/shutdown.c#L132 https://github.com/mattl/opensource.apple.com/blob/88cbaab4a...
- mgranados 7y ago¯\_(ツ)_/¯
- floatingatoll 7y agoIt’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 :)
- jimktrains2 7y agoI guess I'm confused as to the specificity of this. Why are a paternal uncle's daughters not included? Why only elder? Also curious as to why this is important enough to have a specific type of contact for?
- aitchnyu 7y agoAnybody 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?
- epaga 7y agoI am pretty sure it is because in some languages (such as Arabic), there are specific, different words for relatives in those different cases. Someone more knowledgable than I can probably confirm.
- masklinn 7y agoThis one seems to come from chinese * in many EA and SEA culture, there's a difference made based on the age differential aka different term of address to people older than you v younger than you, also gender * chinese (and likely others) also make a difference between patrilineal relationships and matrilineal, so there's a term of address for people related through the father's brother (and thus sharing your family name) versus other parent's sibling (not sharing your family name). The combination of the two yields what you have above: * cousins through your father's brother (sharing family name) are 堂 (táng) all others are 表 (biǎo) * older brother is 兄 (xiōng), younger brother is 弟 (dì), elder sister is 姊 (zǐ) and younger sister is 妹 (mèi) Therefore an older "sister" (same generational rank) through an other line than your father brothers would be 表姊 (biǎozǐ).
- echaozh 7y agoWell we mainlanders prefer 姐(jie). Biaozi sounds the same as bitch so it's never heard.
- deleted 7y ago[deleted]
- deleted 7y ago[deleted]
- ttflee 7y agoCould these ever be swiftified as enums?
- enriquto 7y agoCamel case needs to die, it's been too long and it's not funny anymore.
- TorKlingberg 7y agoI 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. 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.
- SyneRyder 7y agoGenuinely 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.)
- toxik 7y agofaster = faders syster = father’s sister. Same for all of them. 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_extended_family_and_terminology https://en.m.wikipedia.org/wiki/Chinese_kinship#Common_exten...
- mantas 7y agoDidn't even English have a bunch of words that were lost as time went by? 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.
- zerr 7y ago
- chj 7y agoA good example of poor naming. Explained: Your 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.
- umanwizard 7y agoThe other commenters are saying 表姐 because it was originally "Elder", not "Younger". The moderators decided to change it and break all the discussions.
- princekolt 7y agoWhy is everyone assuming this is about Chinese??? CN is the class prefix for the Contacts.framework library, like every other Apple API. For example: CoreLocation: CL (CLLocation) SpriteKit: SK (SKScene) CloudKit: CK (CKRecord) CoreVideo: CV (CVBuffer) LocalAuthentication: LA (LAContext) So on and so forth...
- duskwuff 7y ago> Why is everyone assuming this is about Chinese??? Because the Chinese kinship system has a specific term for the relationship described by this constant.
- lostphilosopher 7y agoIt's not about the "CN" bit. People are talking about why the variable exists at all. Essentially the reason being ventured is that that relationship has a specific name and meaning in Chinese with no English equivalent beyond an exacting familial definition. Imagine trying to express "grandfather" in a language that doesn't have the concept. You might end up with "father's father." (I know nothing about Chinese. Just reporting what's been said elsewhere.)
- duskwuff 7y ago> Imagine trying to express "grandfather" in a language that doesn't have the concept. Or, for a more concrete example: "daughter-in-law". Many of the English "-in-law" relations may seem foreign to cultures with different conceptions of the extended family.
- sbr464 7y agoThis 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?
- tolgahanuzun 7y agowat? :D
- whoevercares 7y agoLol I would just use pinyin: TangJie/Mei BiaoGe/Di