Live data from Hacker News

CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

developer.apple.com

51–60 of 188 posts

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#51

Earlier quoted context omitted.

And off by one errors

If only there were 1 based PLs.

The 1st one? (It wasn't the zeroth language, which is probably why it couldn't use 0-based indexing)

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#53
post #40

Earlier quoted context omitted.

Those aren’t automatic, though.

HN 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.

Then 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.

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#54
post #31
post #26

Earlier quoted context omitted.

The "CN" is just the prefix for the Contacts framework, it doesn't refer to Chinese

表姐 means older female cousin of a different surname. If surnames are always passed down via the father that implies an elder cousin who is either your mother’s sibling’s daughter or your father’s sister’s daughter.

So what happens if, by chance, a woman in your family marries someone of the same surname? Does the 表姐 label then not apply where it otherwise would?

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#55

Earlier quoted context omitted.

And off by one errors

If only there were 1 based PLs.

Smalltalk arrays and strings are 1-based.

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#56

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_...

Amen. Sometimes it takes what it takes to be precise.

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#57
post #48
post #32

Earlier quoted context omitted.

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

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.

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#58
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 :)

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#59
post #49

Is this just one of those exceptional cases when having a strict variable naming convention doesn't work out?

What else would you name it?

CNBiaoJie

Still easier to understand than this monstrosity, even for those who don’t speak Chinese (assuming they can google the documentation).

Re: CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter

#60

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_...

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.
Post reply on HN