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

nonintuitive and misleading type names #192

Closed
pixelzoom opened this issue Nov 9, 2015 · 3 comments
Closed

nonintuitive and misleading type names #192

pixelzoom opened this issue Nov 9, 2015 · 3 comments
Assignees

Comments

@pixelzoom
Copy link
Contributor

Related to code review #173.

Some (many?) of the type names in this sim are nonintuitive and downright misleading, making it unnecessarily difficult to navigate the code, or locate things by guessing their names. This is no fault of @aaronsamuel137, it was inherited.

Some examples, not exhaustive:

• SpaceObjectsPropertyCheckbox - it's not a Property or a CheckBox, it's a Panel. SpaceObjectsPanel would be better. (What is a "space object", btw?)

• GravityModeMenu - it's not a menu, it's a pair of on/off radio buttons. GravityControl would be better.

• PlanetModeMenu - it's not a menu, it's a set of radio buttons. And it doesn't select a planet, it selects a configuration of planets and satellites. Not sure what the proper name would be, maybe something like SystemControl?

• RightControlPanel - there are 2 control panels in the sim, and they are both on the right. How about a name that represents the nature of the stuff being controlled?

It's never fun to have to rename types (and their associated vars at call sites). But if this isn't done now, it will mean more difficult maintenance in the future.

@pixelzoom
Copy link
Contributor Author

PlanetModeMenu might be renamed to simply ModeControl, since a "mode" in this sim is described (in see GravityAndOrbitsModule JSdoc) as a "configuration of bodies":

* The GravityAndOrbitsModule has a set of "modes", one mode for each configuration of bodies (eg, Sun + Planet).

@aaronsamuel137
Copy link
Contributor

I've renamed three of the files, let me know if these names seem clear enough to you.

Regarding RightControlPanel, it is difficult to name it something related to its content since it has 3 sections. ModeGravityCheckboxControlPanel seems weird.

What do you think about these?

  • UpperRightControlPanel
  • GravityAndOrbitsControlPanel (from Java)
  • ControlPanel

@pixelzoom
Copy link
Contributor Author

Let's go with UpperRightControlPanel. I hate naming things based on their layout, but can't come up with anything better in this situation. I'm going to go ahead and close this. @aaronsamuel137 if there's anything else, please reopen.

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

3 participants