0

Why questions about naming are considered "opinion-based"?

If you working in the team you will spend some amount of your "productive" time on the naming.
I am pretty sure that every developer have moments when he struggling with names for new functions, variables, classes etc.
Proper names saves time for other developers who reads your code and even for yourself after few weeks.

When you see a class with a name SomethingBuilder - you expects that this class will create new objects based on the arguments passed to the SomethingBuilder.
When you see method with name GetItem you expect that that method will return object without changing state of the context.

In case when you or your team cares about naming, naming become equally important as choosing design patterns.
Naming not based anymore on the opinion of developer - it based on the logic used in the method/class or output data.

If I can logically ground why one name can be more "effective", "readable" in particular case, than another, then, I think, it cannot be, so easily, considered as opinion-based anymore.

I think this question is not duplicate to the On the troubles of naming and terminology, because my question cover the case from this answer

What should I name this thing?

Which is not a "guessing game" question; it is primarily opinion-based. There are literally an infinite number of such questions; none of them are at all interesting to experts unless they can be answered from a principle-based perspective, in a way that could help others improve their naming skills.

In my question I tried pointed out, that questions about naming with proper description of the problem can be considered as not opinion-based.
Questioner expects logically proved/explained reason for the suggested name in same way as question about "How/What pattern can be implemented in specific issue."

3

If I can logically ground why one name can be more "effective", "readable" in particular case, than another, then, I think, it cannot be, so easily, considered as opinion-based anymore.

Sorry, but I don't buy that. When people agree that one name is more descriptive or readable than another name (for a function or class or variable), this is never independent from the group of people in stake, or the technical context, or the cultural context. Even if you have a list of "10 candidate names" for a thing, give that list to 5 different experts and you get at least 6 different opinions which name fits best.

In short, I agree clearly to Robert Harvey to what he wrote in his answer to "On the troubles of naming and terminology" - when there is no well-known concept behind the question, and the question is not about general "principles of naming things", it should be closed as "opinionated".

  • Function name should describe possible output or possible change of state (global or current object) - can this advise be considered as "well-known concept" or "general principles of naming things"? – Fabio Mar 9 '17 at 12:10
  • @Fabio: this half-sentence does not sound like a question to me, more like an answer. And I am not going to rate such a statement outside of its context. – Doc Brown Mar 9 '17 at 13:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .