Skip to content
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

Inari-Whitebear
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor Author

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

@batmuffino
Copy link

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

@jrose-apple
Copy link
Contributor

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
Copy link
Contributor

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
Copy link

@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
Copy link
Contributor

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

@DylanLukes
Copy link

@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
Copy link

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
Copy link

@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
Copy link
Contributor

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
Copy link

landaire commented Dec 5, 2015

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

@DylanLukes
Copy link

On further consideration, agreed.

@nbulous
Copy link

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
Copy link

@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
Copy link

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
Copy link
Contributor

How about CreatorMutator and ReaderMutator?

@radex
Copy link
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
Copy link

kmonsoor commented Dec 5, 2015

+1 for Primary/Secondary.

@beccadax
Copy link
Contributor

beccadax 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
Copy link
Contributor Author

@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
Copy link
Contributor

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!

@swiftlang swiftlang locked and limited conversation to collaborators Dec 5, 2015
@jckarter
Copy link
Contributor

jckarter commented Dec 6, 2015

Thanks @Inari-Whitebear!

jckarter added a commit that referenced this pull request Dec 6, 2015
Change language in test case to more accurately describe peer relationship of threads
@jckarter jckarter merged commit a42ce37 into swiftlang:master Dec 6, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.