3 ms·
In functional languages, functionality should be extrinsic (case match values from the outside), while in OO languages like functionality is intrinsic (polymorp
by seanmcdirmid 11y ago
In functional languages, functionality should be extrinsic (case match values from the outside), while in OO languages like functionality is intrinsic (polymorphic method members called on the value). However, for things like hashing, intrinsic works way better (hence traits, protocols, type classes, and so on).
Saying use composition over inheritance "wherever possible" can lead to some cargo culting on its own. It is always possible to use composition over inheritance, but it isn't always wise.
- Manishearth 11y ago> but it isn't always wise. Pretty much what I meant, when I said "wherever possible" I meant "wherever possible with decent code", sorry about the confusion.