Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up(Properly) fix potentially inconsiderate naming #218
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Inari-Whitebear
Dec 5, 2015
Contributor
I see, will have to find a better fitting thingy then, maybe.
|
I see, will have to find a better fitting thingy then, maybe. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
batmuffino
commented
Dec 5, 2015
|
Why can't we just call it 'Doer' and 'AlsoDoer' and call it a day? :) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.
|
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 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.
|
I like "primary/secondary". That's a minimal change from what's there. No objections to just using an Int, though. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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 @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 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 I propose
The only problem, of course, is that because there's only one |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.)
|
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.) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
landaire
commented
Dec 5, 2015
|
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
DylanLukes
commented
Dec 5, 2015
|
On further consideration, agreed. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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?). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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 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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
How about |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kmonsoor
commented
Dec 5, 2015
|
+1 for Primary/Secondary. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.)
|
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.) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.
|
@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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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!
|
We're deep in Wadler's law territory at this point. |
apple
locked and limited conversation to collaborators
Dec 5, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Thanks @Inari-Whitebear! |
Inari-Whitebear commentedDec 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.