7

OK, I know there is a tag here, but naming often includes some degrees of opinion. Is asking about naming conventions off-topic?

6
  • Tough to say...you can have entire frameworks like Rails whose entire magic is built around that.
    – Makoto
    Dec 7, 2015 at 6:54
  • 1
    It really depends on the question.
    – Maroun
    Dec 7, 2015 at 6:59
  • 1
    Some languages and/or platforms encourage or even enforce specific naming conventions. Documenting them and how they relate to the OP's problem seems on topic.
    – chqrlie
    Dec 7, 2015 at 9:23
  • 1
    @chqrlie: When the naming is enforced, sure. When a convention is "encouraged", however, it's a matter of personal preference if you'd follow that guideline or not.
    – Cerbrus
    Dec 7, 2015 at 10:27
  • 1
    @Cerbrus: yes, but it way be useful to the OP to explain the rationale for such encouragements. Many newbie programmers are unaware of rational reasons for idiomatic constructions. I agree we should not start useless trolls about personal preferences, and keep such discussions focussed on the OP's best interests.
    – chqrlie
    Dec 7, 2015 at 11:41

3 Answers 3

2

It's quite easy for naming conventions to just be opinion based. It will often be the case that they are, but that doesn't mean there's no way to give a definitive answer to the question.

Python has an official style guide that explicitly dictates an overall naming style for the language. If someone wanted to ask how should they name constants in Python there's a de facto answer to be written which references this guide and tells them to use UPPER_SNAKE_CASE.

This removes the opinion based problem because there's a verifiable answer that can just be considered correct. However if no such correct answer can exist, then it's an opinion based question as people can only suggest what they consider a good idea.

2
  • 2
    "The naming conventions of Python's library are a bit of a mess, so we'll never get this completely consistent -- nevertheless, here are the currently recommended naming standards." - The first line in that link. These guidelines are nothing but suggestions. They're not based on facts or functionalities, and using them or not is a matter of personal preference. Personally, I'd do anything to avoid CAPITAL CASE in my code. Answering a question with that documentation is nothing but: "In my opinion, you should follow these guidelines."
    – Cerbrus
    Dec 7, 2015 at 10:25
  • 1
    @Cerbrus It's acknowledging that it's never going to be perfect, I don't think that quote is saying there's no point to following the conventions. Just that they're not airtight and everpresent. I don't think Stack Overflow is about facts as much as it is about answers that can be backed up with something. You wanting to ignore the suggested style doesn't invalidate that there is an answer to the theoretical question "Is there a style for naming constants in Python?". Dec 7, 2015 at 10:29
1

It depends on the question.
Often, those questions are opinion-based, and should be closed as such.

These are, in my opinion, some examples of opinion based questions:

While this question seem to be just fine, as far as "opinion-based" is concerned:

Yet that one is closed. (Incorrectly, in my opinion)

9
  • "While this question seem to be just fine" Meh. It asks for "A more elegant solution". Highly opinionated. And the comments basically back that up, nobody feels obliged to answer it and just pass suggestions which turn out to be irrelevant. IMO that is an excellent example of why it is not a good question.
    – Gimby
    Dec 7, 2015 at 9:59
  • @Gimby: I'm not sure "opinion based" would be the best fit for the last example. I'm not saying the question is good, though. If anything, this also illustrates naming-conventions is tricky. I'm having trouble finding a good question.
    – Cerbrus
    Dec 7, 2015 at 10:22
  • Indeed; here is a question I think is the other way around. It is in fact not opinion based but simply quite a bit of work to factually answer - yet closed as opinion based: stackoverflow.com/questions/23794482/…
    – Gimby
    Dec 7, 2015 at 10:41
  • @Gimby: That's an excellent example. The answer on it, while short, give some solid reasoning why it's a good idea to stick to the convention.
    – Cerbrus
    Dec 7, 2015 at 10:50
  • @Cerbrus maybe a burnination is in order, then?
    – Magisch
    Dec 7, 2015 at 10:51
  • @Magisch: I think the link Gimby provided is an example that shows why the tag does have merit.
    – Cerbrus
    Dec 7, 2015 at 10:53
  • @Cerbrus does this tag make the question though? I think this question and any other that is related to naming conventions of a specific language (like java) could easily do without the tag, while there are a ton of off topic questions tacitly invited by the tag.
    – Magisch
    Dec 7, 2015 at 10:55
  • @Magisch: Just the language tag doesn't really cover the question, though. However, naming-conventions is very similar to best-practices
    – Cerbrus
    Dec 7, 2015 at 11:03
  • 1
    Yay for the meta effect, the question has been re-opened apparently :)
    – Gimby
    Dec 7, 2015 at 14:51
0

I tend to ask theoretical questions like naming conventions, design choices or program structure on Programmers. But even there, about 30% questions on that tag are closed.

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