Bug #4621
closedCorrect code style guideline 2.18
100%
Description
Code style guideline 2.18 states that we should suffix entity number variables with "No". As a native English speaker, this sounds a bit strange to me. Meanwhile, these names would sound more natural if "Num" was used instead.
Updated by Eric Newberry over 6 years ago
- Status changed from New to In Progress
Updated by Eric Newberry over 6 years ago
- Status changed from In Progress to Code review
- % Done changed from 0 to 100
Updated by Alex Afanasyev over 6 years ago
I would make a different suggestion. Let's remove this rule :)
Updated by Eric Newberry over 6 years ago
Alex Afanasyev wrote:
I would make a different suggestion. Let's remove this rule :)
I agree. Time spent following trivial rules like this distracts from getting actual coding work done. Unless there's a very good reason to keep some variable names with an exact suffix, we should remove it.
Updated by Junxiao Shi over 6 years ago
I disagree with changing or removing rule 2.18.
- No. is abbreviation of “number”, https://en.m.wiktionary.org/wiki/No.
- Not using “Num” suffix eliminates the confusion with “count” (rule 2.17), which is often expressed as “number of something” in natural language.
The goal of codebase is not “not weird”, but eliminate ambiguity.
Updated by Eric Newberry over 6 years ago
Junxiao Shi wrote:
I disagree with changing or removing rule 2.18.
- No. is abbreviation of “number”, https://en.m.wiktionary.org/wiki/No.
Yes, but it is not used in this situation. "No" is often used in addresses and titles (e.g., "Fire Station No. 2"), while "Num" is more generic.
- Not using “Num” suffix eliminates the confusion with “count” (rule 2.17), which is often expressed as “number of something” in natural language.
The goal of codebase is not “not weird”, but eliminate ambiguity.
There is no more ambiguity with using "Num" than using "No". "n" from guideline 2.17 is a prefix, while both of these are suffixes. They also both share the same number of letters with "n". Also, if they both mean the same thing, then how could "Num" cause more confusion with "number of something" than "No"?
Updated by Davide Pesavento over 6 years ago
- Status changed from Code review to Closed
- Target version set to v0.7