|
|
|
|
|
by Ankintol
1971 days ago
|
|
> In general, object orientation is a reasonably elegant way of binding together a compound data type and functions that operate on that data type. Let us accept this at least, and be happy to use it if we want to! Is it elegant? OO couples data types to the functions that operate on them. After years of working on production OO I've still never come across a scenario where I wouldn't have been equally or better served by a module system that lets me co-locate the type with the most common operations on that type with all the auto-complete I want: //type
MyModule {
type t = ...
func foo = ...
func bar = ...
}
If I want to make use of the type without futzing around with the module, I just grab it and write my own function |
|
To elaborate, tying methods with the individual/first argument makes it very difficult to model interactions of multiple objects.