Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent naming for attributes representing a count #55

Open
ngjunsiang opened this issue May 16, 2024 · 0 comments
Open

Inconsistent naming for attributes representing a count #55

ngjunsiang opened this issue May 16, 2024 · 0 comments

Comments

@ngjunsiang
Copy link
Contributor

numberOf* vs *Count

In the PDF specification, the two terms are used interchangeably. However, when programming, it is helpful to establish a consistent naming convention so that programmers do not need to keep looking up the attribute names.

There are currently two ways of naming values that represent the count/number of records or values:

outputStream.write_unsigned_int(self.numberOfFixedDatumIDs)
outputStream.write_unsigned_int(self.numberOfVariableDatumIDs)

vs

self.falseTargetCount = falseTargetCount

Pros and cons

Pros of numberOf* naming

  • ???

Pros of *Count naming

  • convenient visual alignment (fixedDatumIDs and fixedDatumIDCount will left-align for easier visual identification when browsing code)
  • shorter attribute names

This is admittedly a minor issue and might not affect many users, though it's clear where my biases lie. Currently it's a minor speedbump for my work on the repo, and I can wait for a resolution on (a) whether consistent naming would be beneficial, (b) which naming convention to go with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant