3 ms·
> But I've honestly never encountered this Boy do I have the perfect example for you then: https://developer.apple.com/documentation/contacts/cnlabelcontactrel
by Anon1096 5y ago
> But I've honestly never encountered this
Boy do I have the perfect example for you then: https://developer.apple.com/documentation/contacts/cnlabelcontactrelationyoungercousinmotherssiblingsdaughterorfatherssistersdaughter https://developer.apple.com/documentation/contacts/cnlabelco...
- berkes 5y agoand, as many people pointed out, the actual domain concept is in Mandarin, and a single word. So a perfect example of the word "Or" that does not denote a logical disjunction but a translation-artifact. I thought it was obvious that it is not literally implied the letters O and R are never allowed after each-other in code. I mean: obviously having a class named OrGate in an electronics simulation is fine. As is OrParty in a system modeling Israelian politics. This is about the word Or denoting that your class, value, type, variable, model etc, is One Or The Other.
- marcellus23 5y agoThen I'm not really sure what your point is. People were talking about the specific domain mentioned, then you said "or" is code smell regardless of domain, then people pointed out why it's _not_ code smell in this domain, then you come back and say "of course it's not code smell in this domain, I was talking about something else".
- berkes 5y agoMy point is that if you have a class, or method, or variable that represents "one thing, or another thing" this is a poor abstraction. And that you can "reek" this smell quite clearly if your names contain "one Or the Other" or "One And The Other" the words "Or" or "And". The example you gave is an artifact of a translation. It is not an indication that this class holds either a "YoungerCousinMothersSiblingsDaughter" class/type/value Or a "FathersSistersDaughter". First, because AFAICS these separate things don't exist. And second because of the first part of that name: `LabelContactRelation`, it being a label; not a return value. You did pay attention to the part where I explained that this, naturally, is not literally so, did you?
- marcellus23 5y agoRight, I think you missed my point. If the example being discussed by everyone in this thread does not apply to your point, why did you bring it up in the first place and cause this confusion? And why did you say "Regardless of domain" if that's obviously not true?