top | item 46524528

(no title)

hosh | 1 month ago

Ruby does have language features for composition, and “composition over inheritance” has popped up in the community. I have also looked into the use of traits in Smalltalk.

discuss

order

lloeki|1 month ago

Absolutely, usage of inheritance is (comparatively to Java/C++/Python) quite rare in Ruby.

People favour modules to compose (e.g Enumerable), and more generally interfaces (e.g duck-typed StringIO vs IO/File/etc...)

If you throw in RBS and start to type Ruby things then you start to see that Go-style interfaces pop up quite frequently.