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

Built-in predicate names #46

Closed
kstenerud opened this issue Feb 8, 2019 · 2 comments
Closed

Built-in predicate names #46

kstenerud opened this issue Feb 8, 2019 · 2 comments

Comments

@kstenerud
Copy link

The names chosen for some of the built-in predicates don't match those commonly used in other languages, increasing cognitive load and the potential for user error. Please consider using the common names instead:

dry common
eql eq
gt gt
gteq ge
lt lt
lteq le
@igor-alexandrov
Copy link
Contributor

Arel has eq, gteq and lteq: https://www.rubydoc.info/github/rails/arel/Arel/Predications.

Based on my experience, I think that eql can be confusing, but gteq and lteq are common used in Ruby.

@solnic
Copy link
Member

solnic commented Jun 22, 2019

Given that we have 4 years of history with these predicates, I don't think it's worth the effort to change it now, especially that:

  • gteq? and lteq? are used in other gems
  • eql? is called eql? because it uses Object#eql? which makes a lot of sense, let's be consistent with the method name especially that there are differences in behavior between == and eql?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants