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

Combine all quantity modules into one huge Quantity module? #31

Open
ianmackenzie opened this issue Apr 23, 2019 · 0 comments
Open

Combine all quantity modules into one huge Quantity module? #31

ianmackenzie opened this issue Apr 23, 2019 · 0 comments

Comments

@ianmackenzie
Copy link
Owner

Pros

  • Only one module to import
  • Less risk of module naming collisions
  • Unified namespace for operators: Quantity.sin instead of Angle.sin
  • More understandable naming for pixel-related functions: Quantity.pixels, Quantity.inPixels instead of Pixels.pixels, Pixels.inPixels

Cons

  • Breaking change
  • Huge module documentation page to try to browse through
  • Could basically be accomplished by module aliasing instead (with a few function renames to avoid conflicts)
  • Doesn't play quite as nicely with defining custom units/quantity types (would have to 'merge' those with the main Quantity module, which can be confusing)

Required changes

  • Rename Mass.pounds/Mass.inPounds to poundsMass/inPoundsMass to not conflict with Force.pounds/Force.inPounds
  • When Add minutes/seconds support to Angle #21 is implemented, use arcminutes/arcseconds instead of minutes/seconds

Since Temperature would still be a separate module, could have both Temperature.degreesCelsius (temperature) and Quantity.degreesCelsius (temperature delta).

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