I get acquainted with Ruby, and for the first time I see method synonyms in the standard library. So far I have found those that are in the Enumerable module:
collect <-> map
detect <-> find
include <-> member
etc.
Other modules may also contain synonymous methods. Why are they there? Is it some kind of backward compatibility? Or is it a feature of the language, so the programmer can choose between different options depending on the context, so that the program looks like plain English?
source
share