In the Ruby API I notice a lot of methods are aliased. For instance to iterate over the lines in a String I can call str.lines or str.each_line.
How do you decide which one to use? Are some alias names deprecated and remain for historic reasons? Or are aliases just part of the Ruby philosophy of many ways to do the same thing and chosen based on making readable code?
Often many methods which do the same thing are provided to allow your code to be more expressive and “sentence like”.
#linesmight make this code read more like a sentence:While
#each_linemight read better here: