OK, I know there is a naming-conventions tag here, but naming often includes some degrees of opinion. Is asking about naming conventions off-topic?
-
Tough to say...you can have entire frameworks like Rails whose entire magic is built around that.– MakotoDec 7, 2015 at 6:54
-
1It really depends on the question.– MarounDec 7, 2015 at 6:59
-
On the troubles of naming and terminology– gnatDec 7, 2015 at 7:08
-
1Some 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.– chqrlieDec 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.– CerbrusDec 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.– chqrlieDec 7, 2015 at 11:41
3 Answers
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"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."– CerbrusDec 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
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:
- How to choose function names? (Already closed as dupe)
- Laravel Blade Naming Convention
While this question seem to be just fine, as far as "opinion-based" is concerned:
Yet that one is closed. (Incorrectly, in my opinion)
-
"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.– GimbyDec 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.– CerbrusDec 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/…– GimbyDec 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.– CerbrusDec 7, 2015 at 10:50
-
-
@Magisch: I think the link Gimby provided is an example that shows why the tag does have merit.– CerbrusDec 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.– MagischDec 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– CerbrusDec 7, 2015 at 11:03
-
1
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.