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

Possible remaming of num and den? #19233

Closed
TotalVerb opened this issue Nov 6, 2016 · 8 comments
Closed

Possible remaming of num and den? #19233

TotalVerb opened this issue Nov 6, 2016 · 8 comments
Labels
good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request
Milestone

Comments

@TotalVerb
Copy link
Contributor

TotalVerb commented Nov 6, 2016

Could num and den be renamed to numerator and denominator? These function names are very unintuitive, and general policy is to avoid abbreviations unless they're very standard.

@StefanKarpinski
Copy link
Member

Sure, seems like a good idea.

@StefanKarpinski StefanKarpinski added help wanted Indicates that a maintainer wants help on an issue or pull request good first issue Indicates a good issue for first-time contributors to Julia labels Nov 6, 2016
@JeffBezanson JeffBezanson added this to the 0.6.0 milestone Nov 6, 2016
@thofma
Copy link
Contributor

thofma commented Nov 8, 2016

Where is the problem? There could not be more intuitive names for these functions. When your are working with rational types, it is only natural to look for something like num or den. No need to make it too verbose.

Please keep the abbreviations. They are standard.

@KristofferC
Copy link
Member

There could not be more intuitive names for these functions.

I disagree, numerator is more intuitive than num. This also has precedence from Python:

>>> from fractions import Fraction
>>> a = Fraction(16, -10)
>>> a.denominator
5
>>> a.numerator
-8

@TotalVerb
Copy link
Contributor Author

And Racket.

@StefanKarpinski
Copy link
Member

Can you cite some languages or libraries where this naming is used? Mathematica uses "Numerator" and "Denominator"; Python uses "numerator" and "denominator". Matlab doesn't have a standard way of representing or operating on rational numbers. R doesn't seem to either.

@ararslan
Copy link
Member

ararslan commented Nov 9, 2016

Ruby also uses numerator and denominator, as does C++ via Boost.

If anything, Julia appears to be the odd one out here.

@martinholters
Copy link
Member

Add Haskell to the list for numerator and denominator.

@thofma
Copy link
Contributor

thofma commented Nov 10, 2016

Ok, convinced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

No branches or pull requests

7 participants