[#83107] Alias Enumerable#include? to Enumerable#includes? — Alberto Almagro <albertoalmagro@...>

Hello,

9 messages 2017/10/04

[ruby-core:83150] Re: Alias Enumerable#include? to Enumerable#includes?

From: Alberto Almagro <albertoalmagro@...>
Date: 2017-10-06 07:21:06 UTC
List: ruby-core #83150
Then we should stop evolving the language because all the new stuff we
could introduce would eventually increase learning,
review, optimization, and implementation costs, right?

2017-10-06 9:04 GMT+02:00 Eric Wong <normalperson@yhbt.net>:

> Alberto Almagro <albertoalmagro@gmail.com> wrote:
> > this was mentioned at Euruko's conference by Bozhidar Batsov and fully
> > resonated with my own personal experience using Ruby. As I tweeted after
> > the conference I would like to contribute to make Ruby better, and
> > aliasing Enumerable#include? with Enumerable#includes? would be a great
> > start. I simply can't remember how many times I have written includes?
> > instead of include? Last Saturday I definitely confirmed that I'm not the
> > only one. What do you think?
>
> Having multiple names for the same thing increases learning,
> review, optimization, and implementation costs.  IMHO, Ruby
> already has too many aliases which make things more difficult
> than they should be; we should not add more aliases.
>
>
> Furthermore, there are many classes outside Enumerable with
> "include?" which would also need "includes?" for consistency if
> your change were accepted.  This also applies to 3rd-party
> libraries like Rack and Rails which subclass core Ruby classes
> or define workalike "include?" methods for databases or
> case-insensitive hashes.
>
> Introducing a second name would be harmful to polymorphic use.
>
> If Ruby were a brand new language with no baggage, we may only
> have "includes?" instead.  But Ruby has tons of outside
> dependencies which already rely on "include?" for several
> decades, now.
>
>
> A similar example: *nix has a similar problem with "creat" and
> "O_CREAT".  Introducing "create" and "O_CREATE" as aliases at
> this point would only harm compatibility, portability, and
> reviewability.
>
> Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
>

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread