New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Properly) fix potentially inconsiderate naming #218

Merged
merged 2 commits into from Dec 6, 2015

Conversation

Projects
None yet
@Inari-Whitebear
Contributor

Inari-Whitebear commented Dec 5, 2015

So I don't mind master/slave terminology, but if you're going to fix it, at least end up with something others chose too. See django which ended up with Primary/Replica (after first adopting Leader/Follower in django/django#2692) in django/django#2694 (which was just closed, but still changed in django/django@beec056 )

The only thing I personally have against Leader/Follower is that it is a bit odd as a german (and seems I'm not alone in that feeling). Though I wouldn't mind that had it not already been changed from master/slave anyway. Just want it changed "properly" if it gets changed at all. It also seems to be used in literature already from what I was told.

@cwillmor

This comment has been minimized.

Show comment
Hide comment
@cwillmor

cwillmor Dec 5, 2015

Member

Primary/replica works well for Django where it refers to database replication. But this test deals with one thread coordinating another. There's no replication involved.

Member

cwillmor commented Dec 5, 2015

Primary/replica works well for Django where it refers to database replication. But this test deals with one thread coordinating another. There's no replication involved.

@Inari-Whitebear

This comment has been minimized.

Show comment
Hide comment
@Inari-Whitebear

Inari-Whitebear Dec 5, 2015

Contributor

I see, will have to find a better fitting thingy then, maybe.

Contributor

Inari-Whitebear commented Dec 5, 2015

I see, will have to find a better fitting thingy then, maybe.

@batmuffino

This comment has been minimized.

Show comment
Hide comment
@batmuffino

batmuffino Dec 5, 2015

Why can't we just call it 'Doer' and 'AlsoDoer' and call it a day? :)

batmuffino commented Dec 5, 2015

Why can't we just call it 'Doer' and 'AlsoDoer' and call it a day? :)

@jrose-apple

This comment has been minimized.

Show comment
Hide comment
@jrose-apple

jrose-apple Dec 5, 2015

Member

To quote Katie Mack, "This is not a change we make for the people it doesn't matter to.". Feel free to ignore these kinds of changes if they don't interest you.

Member

jrose-apple commented Dec 5, 2015

To quote Katie Mack, "This is not a change we make for the people it doesn't matter to.". Feel free to ignore these kinds of changes if they don't interest you.

@jckarter

This comment has been minimized.

Show comment
Hide comment
@jckarter

jckarter Dec 5, 2015

Member

I think you're on to something, @batmuffino. Looking over the test, I see no structured relationship between the threads at all. Doing away with the enum altogether and just marking them as 0 and 1 is probably a more accurate model.

Member

jckarter commented Dec 5, 2015

I think you're on to something, @batmuffino. Looking over the test, I see no structured relationship between the threads at all. Doing away with the enum altogether and just marking them as 0 and 1 is probably a more accurate model.

@batmuffino

This comment has been minimized.

Show comment
Hide comment
@batmuffino

batmuffino Dec 5, 2015

@jrose-apple that's why I mentioned using the most simple names with least connotation. As a german, master/slave sounds less inconsiderate than leader/follower. But since it's basically just as @jckarter says one could also just call it primary/secondary or sth.

batmuffino commented Dec 5, 2015

@jrose-apple that's why I mentioned using the most simple names with least connotation. As a german, master/slave sounds less inconsiderate than leader/follower. But since it's basically just as @jckarter says one could also just call it primary/secondary or sth.

@jrose-apple

This comment has been minimized.

Show comment
Hide comment
@jrose-apple

jrose-apple Dec 5, 2015

Member

I like "primary/secondary". That's a minimal change from what's there. No objections to just using an Int, though.

Member

jrose-apple commented Dec 5, 2015

I like "primary/secondary". That's a minimal change from what's there. No objections to just using an Int, though.

@DylanLukes

This comment has been minimized.

Show comment
Hide comment
@DylanLukes

DylanLukes Dec 5, 2015

@cwillmor By the same logic, wouldn't Parent/Child make more sense here, since we're dealing with threads? Primary/Secondary is ok, but Secondary is vague and imprecise. Edit: based on @jrose-apple's further explanation, Primary/Secondary actually seems to be the best bet.

@batmuffino But the connotation is what's important. The denotational meaning of these words is already out the window. We're using words to refer to programming concepts by analogy. We're squarely and entirely in the realm of connotation here. The question is, how can we pick names with connotations that allow users to quickly grok.

But, let's actually look at what makes a good name, because I don't think Primary/Replica OR Leader/Follower are very good names at all. Slave/Master is the most semantically correct based on etymology and and the most technically correct based on prior usage of these three: the only major negative is the potential for offense due to the association with 20th century American chattel slavery. I'll make no statement of opinion on whether I think this is reasonable or not because in the current climate that's basically career suicide.

For reference, from Wikipedia: "Master/slave is a model of communication where one device or process has unidirectional control over one or more other devices.". Makes a fair amount of sense.

But, if this is going to be changed, it should be changed to something that is maximally either directly or metaphorically descriptive. And if we can offend less people in the process, that's cool.

While Leader/Follower are "nice" names indeed, they are not semantically consistent. They imply a very different relationship. They'd make great sense in, say, a pub-sub model, where a Follower willingly chooses to follow a Leader. Primary/Replica are also not good names, they are totally unrelated to this particular case and are almost exclusively used in data-related contexts (RDBMS, file sharing, etc).

I propose Parent/Child. It's:

  • Accepted and widely-used terminology for processes and threads.
  • Concise and semantically reasonable.
  • Doesn't offend anyone.

The only problem, of course, is that because there's only one Parent, it could be construed as an attempt to subtly undermine American family values and the notion of the atomic family. 😉

DylanLukes commented Dec 5, 2015

@cwillmor By the same logic, wouldn't Parent/Child make more sense here, since we're dealing with threads? Primary/Secondary is ok, but Secondary is vague and imprecise. Edit: based on @jrose-apple's further explanation, Primary/Secondary actually seems to be the best bet.

@batmuffino But the connotation is what's important. The denotational meaning of these words is already out the window. We're using words to refer to programming concepts by analogy. We're squarely and entirely in the realm of connotation here. The question is, how can we pick names with connotations that allow users to quickly grok.

But, let's actually look at what makes a good name, because I don't think Primary/Replica OR Leader/Follower are very good names at all. Slave/Master is the most semantically correct based on etymology and and the most technically correct based on prior usage of these three: the only major negative is the potential for offense due to the association with 20th century American chattel slavery. I'll make no statement of opinion on whether I think this is reasonable or not because in the current climate that's basically career suicide.

For reference, from Wikipedia: "Master/slave is a model of communication where one device or process has unidirectional control over one or more other devices.". Makes a fair amount of sense.

But, if this is going to be changed, it should be changed to something that is maximally either directly or metaphorically descriptive. And if we can offend less people in the process, that's cool.

While Leader/Follower are "nice" names indeed, they are not semantically consistent. They imply a very different relationship. They'd make great sense in, say, a pub-sub model, where a Follower willingly chooses to follow a Leader. Primary/Replica are also not good names, they are totally unrelated to this particular case and are almost exclusively used in data-related contexts (RDBMS, file sharing, etc).

I propose Parent/Child. It's:

  • Accepted and widely-used terminology for processes and threads.
  • Concise and semantically reasonable.
  • Doesn't offend anyone.

The only problem, of course, is that because there's only one Parent, it could be construed as an attempt to subtly undermine American family values and the notion of the atomic family. 😉

@landaire

This comment has been minimized.

Show comment
Hide comment
@landaire

landaire Dec 5, 2015

I was thinking the same as @DylanLukes. In the context of threading/processes it's already common wording that people are familiar with. Primary could possibly be confused with the main thread as well and in my opinion they don't convey the same meaning (although I could be misunderstanding this context).

landaire commented Dec 5, 2015

I was thinking the same as @DylanLukes. In the context of threading/processes it's already common wording that people are familiar with. Primary could possibly be confused with the main thread as well and in my opinion they don't convey the same meaning (although I could be misunderstanding this context).

@DylanLukes

This comment has been minimized.

Show comment
Hide comment
@DylanLukes

DylanLukes Dec 5, 2015

@landaire Good point on confusion. Might be worth grepping the repository for usages of any suggested terms. Whatever is picked, it shouldn't already be in use in with a different meaning.

Inconsistent signifieds are even worse than inconsistent signifiers.

DylanLukes commented Dec 5, 2015

@landaire Good point on confusion. Might be worth grepping the repository for usages of any suggested terms. Whatever is picked, it shouldn't already be in use in with a different meaning.

Inconsistent signifieds are even worse than inconsistent signifiers.

@jrose-apple

This comment has been minimized.

Show comment
Hide comment
@jrose-apple

jrose-apple Dec 5, 2015

Member

In this test case, the threads aren't actually in a parent/child relationship. There's one that goes first, and one that goes second, but the "parent" thread is the main thread. (See the full file.)

Member

jrose-apple commented Dec 5, 2015

In this test case, the threads aren't actually in a parent/child relationship. There's one that goes first, and one that goes second, but the "parent" thread is the main thread. (See the full file.)

@landaire

This comment has been minimized.

Show comment
Hide comment
@landaire

landaire Dec 5, 2015

Primary/Secondary would probably make more sense in this context then.

landaire commented Dec 5, 2015

Primary/Secondary would probably make more sense in this context then.

@DylanLukes

This comment has been minimized.

Show comment
Hide comment
@DylanLukes

DylanLukes Dec 5, 2015

On further consideration, agreed.

DylanLukes commented Dec 5, 2015

On further consideration, agreed.

@nbulous

This comment has been minimized.

Show comment
Hide comment
@nbulous

nbulous Dec 5, 2015

Some other alternatives that I haven't seen mentioned here are: Master/Follower, , Leader/Follower, Coordinator/Worker, Dispatcher/Runner, Queen/Worker (bees, anyone?).

nbulous commented Dec 5, 2015

Some other alternatives that I haven't seen mentioned here are: Master/Follower, , Leader/Follower, Coordinator/Worker, Dispatcher/Runner, Queen/Worker (bees, anyone?).

@DylanLukes

This comment has been minimized.

Show comment
Hide comment
@DylanLukes

DylanLukes Dec 5, 2015

@nbulous Leader/Follower is what's there right now. Master/Follower is practically the same. I don't think any of your other suggestions really make sense in context. Based on what what @jrose-apple pointed out, Primary/Secondary or even just First/Second make the most sense.

Or, just integers. It's just a test case. All that really matters is that someone can read this and understand what's going on in the event that the test fails, or if they're reading tests to grok functionality.

DylanLukes commented Dec 5, 2015

@nbulous Leader/Follower is what's there right now. Master/Follower is practically the same. I don't think any of your other suggestions really make sense in context. Based on what what @jrose-apple pointed out, Primary/Secondary or even just First/Second make the most sense.

Or, just integers. It's just a test case. All that really matters is that someone can read this and understand what's going on in the event that the test fails, or if they're reading tests to grok functionality.

@beren12

This comment has been minimized.

Show comment
Hide comment
@beren12

beren12 Dec 5, 2015

Leader/Follower is just odd. Please stick to programming terminology: Master/Slave, Parent/Child, etc. Code is confusing enough to not need to worry about this waste of time. There is nothing "bad" about a slave/child process/test/thread. Honestly Leader/Follower makes no sense.

beren12 commented Dec 5, 2015

Leader/Follower is just odd. Please stick to programming terminology: Master/Slave, Parent/Child, etc. Code is confusing enough to not need to worry about this waste of time. There is nothing "bad" about a slave/child process/test/thread. Honestly Leader/Follower makes no sense.

@gribozavr

This comment has been minimized.

Show comment
Hide comment
@gribozavr

gribozavr Dec 5, 2015

Collaborator

How about CreatorMutator and ReaderMutator?

Collaborator

gribozavr commented Dec 5, 2015

How about CreatorMutator and ReaderMutator?

@radex

This comment has been minimized.

Show comment
Hide comment
@radex

radex Dec 5, 2015

Contributor

Leader/Follower is just odd. Please stick to programming terminology: Master/Slave

Just because it is standard programming terminology doesn't mean it should be.

Does it affect you and me? No. Is it something super important to change? Perhaps not. But if someone cares and puts in the effort to propose something not as awfully connotated as master/slave, why not?

+1 to Primary/Secondary in this case.

Contributor

radex commented Dec 5, 2015

Leader/Follower is just odd. Please stick to programming terminology: Master/Slave

Just because it is standard programming terminology doesn't mean it should be.

Does it affect you and me? No. Is it something super important to change? Perhaps not. But if someone cares and puts in the effort to propose something not as awfully connotated as master/slave, why not?

+1 to Primary/Secondary in this case.

@kmonsoor

This comment has been minimized.

Show comment
Hide comment
@kmonsoor

kmonsoor Dec 5, 2015

+1 for Primary/Secondary.

kmonsoor commented Dec 5, 2015

+1 for Primary/Secondary.

@brentdax

This comment has been minimized.

Show comment
Hide comment
@brentdax

brentdax Dec 5, 2015

Collaborator

If they're just two peer threads coordinating in an attempt to wreak havoc, let's call them RobinHood and FriarTuck. Or Fred and George. Or anything that doesn't annoy people. (I don't like integers for this purpose; there are exactly two threads, not N threads.)

Collaborator

brentdax commented Dec 5, 2015

If they're just two peer threads coordinating in an attempt to wreak havoc, let's call them RobinHood and FriarTuck. Or Fred and George. Or anything that doesn't annoy people. (I don't like integers for this purpose; there are exactly two threads, not N threads.)

@Inari-Whitebear

This comment has been minimized.

Show comment
Hide comment
@Inari-Whitebear

Inari-Whitebear Dec 5, 2015

Contributor

@brentdax: Interesting. Personally in that case I'd be concerned about another PR popping up someday (not from me, but someone) because both names are male or something. Just covering all the bases.

Contributor

Inari-Whitebear commented Dec 5, 2015

@brentdax: Interesting. Personally in that case I'd be concerned about another PR popping up someday (not from me, but someone) because both names are male or something. Just covering all the bases.

@jckarter

This comment has been minimized.

Show comment
Hide comment
@jckarter

jckarter Dec 5, 2015

Member

We're deep in Wadler's law territory at this point. Primary/Secondary should be fine. @Inari-Whitebear if you don't mind updating your patch to use those terms, I'll take accept the pull request. Thanks for the discussion everyone!

Member

jckarter commented Dec 5, 2015

We're deep in Wadler's law territory at this point. Primary/Secondary should be fine. @Inari-Whitebear if you don't mind updating your patch to use those terms, I'll take accept the pull request. Thanks for the discussion everyone!

@apple apple locked and limited conversation to collaborators Dec 5, 2015

@jckarter

This comment has been minimized.

Show comment
Hide comment
@jckarter
Member

jckarter commented Dec 6, 2015

jckarter added a commit that referenced this pull request Dec 6, 2015

Merge pull request #218 from Inari-Whitebear/master
Change language in test case to more accurately describe peer relationship of threads

@jckarter jckarter merged commit a42ce37 into apple:master Dec 6, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.