Project

General

Profile

Bug #4621

Correct code style guideline 2.18

Added by Eric Newberry almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Docs
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

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.

#1

Updated by Eric Newberry almost 3 years ago

  • Description updated (diff)
#2

Updated by Eric Newberry almost 3 years ago

  • Status changed from New to In Progress
#3

Updated by Eric Newberry almost 3 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100
#4

Updated by Alex Afanasyev almost 3 years ago

I would make a different suggestion. Let's remove this rule :)

#5

Updated by Eric Newberry almost 3 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.

#6

Updated by Junxiao Shi almost 3 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.

#7

Updated by Eric Newberry almost 3 years ago

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"?

#8

Updated by Davide Pesavento over 2 years ago

  • Status changed from Code review to Closed
  • Target version set to v0.7

Also available in: Atom PDF