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

CUP_RANGE_MIN and CUP_RANGE_MAX issues #56

Closed
pixelzoom opened this issue Jun 28, 2022 · 1 comment
Closed

CUP_RANGE_MIN and CUP_RANGE_MAX issues #56

pixelzoom opened this issue Jun 28, 2022 · 1 comment
Assignees

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Jun 28, 2022

For code review #41 ...

In MeanShareAndBalanceConstants.js

  CUP_RANGE_MIN: 0,
  CUP_RANGE_MAX: 1,

First, CUP_RANGE doesn't tell me anything. Is this actually the level of the water in cup? If so, then WATER_LEVEL would be much more meaningful. Or even WATER_HEIGHT, since you have this in WaterCupModel.ts:

waterHeightRange: new Range( MeanShareAndBalanceConstants.CUP_RANGE_MIN, MeanShareAndBalanceConstants.CUP_RANGE_MAX )

Second, you have 9 places where you're creating a Range instance that involve these min/max constants:

new Range( MeanShareAndBalanceConstants.CUP_RANGE_MIN, MeanShareAndBalanceConstants.CUP_RANGE_MAX )

Why not replace CUP_RANGE_MIN and CUP_RANGE_MAX with:

  CUP_RANGE: new Range( 0, 1 ),
@marlitas
Copy link
Contributor

Renamed ranges for clarity, and added a WATER_LEVEL_RANGE to be used when possible. Closing.

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

2 participants