Re:Rails is not written in Ruby
by remram on Saturday February 05, 2022 @02:41PM
(#30225028)
The discussion is about how to provide additional functionality.
To be sortable, you collection has to be a collection, and it has to have comparable elements. That has to be provided by the type itself.
The difference between Python and Ruby is how to add more functions. If you make a library to sort collections (or format phone numbers), the Ruby way is to monkey-patch collections (or numbers). Whereas the Python way is to offer a free function that takes an iterable (or number). This is what we are discussing.
To be sortable, you collection has to be a collection, and it has to have comparable elements. That has to be provided by the type itself.
The difference between Python and Ruby is how to add more functions. If you make a library to sort collections (or format phone numbers), the Ruby way is to monkey-patch collections (or numbers). Whereas the Python way is to offer a free function that takes an iterable (or number). This is what we are discussing.
Of course Python classes have methods.