Bug #4621
closed
Correct code style guideline 2.18
Added by Eric Newberry over 6 years ago.
Updated over 6 years ago.
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.
- Description updated (diff)
- Status changed from New to In Progress
- Status changed from In Progress to Code review
- % Done changed from 0 to 100
I would make a different suggestion. Let's remove this rule :)
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.
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.
Junxiao Shi wrote:
I disagree with changing or removing rule 2.18.
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"?
- Status changed from Code review to Closed
- Target version set to v0.7
Also available in: Atom
PDF