3 ms·
> "I find this variable name confusing. Can we change it to something more like X?" My problem with stating it like this is that when the person saying this is
by woutr_be 6y ago
> "I find this variable name confusing. Can we change it to something more like X?"
My problem with stating it like this is that when the person saying this is in a position of authority it’s extremely hard to say no to it. And that person might not always be necessary right, or the person writing the code had a good reason for this naming, and now can’t argue against it.
While there are best practices for naming, people often have different opinions, but that doesn’t mean one is right and the other one wrong.
- BugsJustFindMe 6y ago> it’s extremely hard to say no to it. Good. A person just told you that you did something that confused them. You don't have to rename it to "X" exactly, but you do need to try to do something that communicates effectively to your collaborators. > And that person might not always be necessary right There is no right. There are only confusing and not-confusing. A person that you're collaborating with just told you that what you did is unclear to them. That means you have to make things more clear. I don't care if your solution to this problem is to just add a comment, as long as you're both happy that the end result communicates your ideas effectively. But you have to do something to fix the fact that your original variable name didn't communicate what you thought it would. > that doesn’t mean one is right and the other one wrong Thinking of names as objectively right or wrong is a mistake. Names either add confusion or reduce confusion. Striving for the latter requires meeting your interlocutor halfway.
- woutr_be 6y ago> A person just told you that you did something confusing. The person told me that I did something confusing to them. And with using that kind of format, almost forces you to have to pick his opinion. Because now instead of clarifying your choice of naming, have to now defend your choice against his or her. > There is no right/wrong here. There is only confusing and not-confusing. A person that you're collaborating with just told you that what you did is _unclear_ to them. That means you have to clarify what you did. A person just told me they find a name confusing, and asked if it can be changed. That person could’ve clarified why it was named a certain way, but instead just proposed a change. Again, the way the comment was written makes it extremely hard to do anything other than use the proposed new name. > Thinking of names as right or wrong is a mistake. Names either add confusion or reduce confusion. Always strive for the latter. That’s an extremely subjective statement, and to me is not how things are in the real world.
- BugsJustFindMe 6y ago> And with using that kind of format, almost forces you to have to pick his opinion. I said that it needs to communicate the right information to both of you, not just to you and not just to them. If their suggestion still communicates to you, then suck it up and admit that they came up with a better name. If it _doesn't_ but you use their suggestion anyway, then you've just failed at being part of a team. It's on you to learn how to say "that's unclear to me, let's look for a third option". > have to now defend your choice It sounds like you think you're likely to feel defensive about having created confusion for someone. Maybe focus less on defending and more on achieving clarity.
- woutr_be 6y ago> I said that it needs to communicate the right information to both of you, not just to you and not just to them. Right, but you see how it took multiple back and forwards to even clarify what you wanted to achieve? The same goes with your original comment. > "I find this variable name confusing. Can we change it to something more like X?" You don't clarify why it's confusing, so I don't know your interpretation of what the variable represents. I need to first understand as to why you find this confusing, and how your new proposed naming will help to clarify. > It sounds like you think you're likely to feel defensive about having created confusion for someone. Maybe focus less on defending and more on achieving clarity. I do not, and it's pretty bad practice to assume this of people. This comes back to the whole nitpicking, to me it sounds like you were nitpicking on the naming. You didn't clarify your stance, or what caused you confusion. And leave it up to me to reach out to you to clarify this. This could've been communicated in your first PR comment, so that we didn't have to go through this dance.
- BugsJustFindMe 6y ago> Right, but you see how it took multiple back and forwards to even clarify what you wanted to achieve? Luckily we're in this together having a conversation with an interest in achieving mutual clarity. > I need to first That's ok! You should feel comfortable expressing your needs. That's the nature of discourse. I guess if I were to turn your argument back around on you I would say "you could have expressed your need from the start." But nobody but me is inside my head and nobody but you is inside your head, and neither of us knows what the other needs until we tell the other. So we do our best to get there eventually. I tell you that your chosen name doesn't make sense to me and propose an alternative that does. Maybe you say "ok, that works for me too", or maybe you say "that doesn't work for me but if you tell me more about the problem maybe there's another alternative." That's how teamwork goes. But if my alternative suggestion _does_ also communicate to the other person but they demand that I convince them anyway because they want to be "right", well, then that person is just being hostile and defensive, which makes being on a team more difficult.