8 ms·
I really whish more people knew about OCaml's object system. I would actually argue that OCaml has a better OO system than most OO languages, but it looks and
by Drup 10y ago
I really whish more people knew about OCaml's object system.
I would actually argue that OCaml has a better OO system than most OO languages, but it looks and feel quite different (it's "functionalish": immutable by default, objects are structural and can be classeless, etc).
In the end, despite its strength, it's used very little in the OCaml community: Modules are better 95% of the time.
The gold standard for doing nice encapsulation, abstraction and separation of concern is neither functions nor objects, it's ML modules.