Method synonyms in Ruby
- by Max
I'm familiarizing myself with Ruby and it's the first time I see synonyms for methods in the standard library. For now I've found the ones in the Enumerable module:
collect <- map
detect <- find
include <- member
etc.
Probably other modules contains synonymic methods too. 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 to make the program look like plain English?