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

better name for HoldConstantEnum? #105

Closed
pixelzoom opened this issue Jun 5, 2019 · 2 comments
Closed

better name for HoldConstantEnum? #105

pixelzoom opened this issue Jun 5, 2019 · 2 comments
Assignees

Comments

@pixelzoom
Copy link
Contributor

HoldConstantEnum is an enumeration that describes the quantities that may be held constant in the model. I'm a little foggy on the PhET naming conventions for enumerations, so I'll inquire on the Slack developer channel.

@pixelzoom pixelzoom self-assigned this Jun 5, 2019
@pixelzoom
Copy link
Contributor Author

pixelzoom commented Jun 5, 2019

Summary of Slack discussion: PhET convention is to avoid suffixes "Enum" and "Enumeration", and consensus was that HoldConstant would be an appropriate name.

complete Slack discussion

Chris Malley [11:18 AM]
Gas Properties has an enumeration that describes the quantities that may be held constant in the model. The enumeration is currently named HoldConstantEnum. I don’t recall if “Enum” is an acceptable suffix. Thoughts?

Saurabh Totey [11:19 AM]
at least in the https://github.com/phetsims/phet-core/blob/master/js/Enumeration.js file, it seems like it says

(1) Enumerations are named like classes/types. Nothing in the name needs to identify that they are Enumerations.
 *     See the example above: CardinalDirection, not CardinalDirectionEum or CardinalDirectionEnumeration.

👍

Chris Malley [11:20 AM]
Great, thanks for the pointer. I will rename to HoldConstant.
And if you don’t mind, I’ll capture this in a GitHub issue, in case it comes up again in code review.
👍

Jesse Greenberg [11:22 AM]
Good to know, I recently with Enum suffix too, I will rename

Chris Malley [11:23 AM]
I sort of feel like HoldConstantEum is clearer in this case. But not strongly enough to want to revisit the naming convention. Unless @jessegreenberg has similar feelings about his enums?

Jesse Greenberg [11:24 AM]
I feel that it is just as clear without the suffix for my case

Chris Malley [11:24 AM]
Sounds good.
My use of “Enum” btw likely comes from habit from Java, C++, C, where enum is a keyword.

pixelzoom added a commit that referenced this issue Jun 5, 2019
@pixelzoom
Copy link
Contributor Author

Name changed to HoldConstant, closing.

pixelzoom added a commit that referenced this issue Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant