3 ms·
They tell people to avoid the things called objects in OCaml which essentially are just row-typed dynamic records and an inheritance system. Really it's the inh
by tel 11y ago
They tell people to avoid the things called objects in OCaml which essentially are just row-typed dynamic records and an inheritance system. Really it's the inheritance system people are taught to avoid... Same as anyone in OO is being taught now.
OTOH OCaml, as an ML, inherits an outstanding module story which is really the core of OO anyway. I'd happily say OCaml is a better OO language than Scala for that reason.
- justthistime_ 11y agoThe module story is pretty comparable and many things can be translated directly between OCaml's module system and Scala's. With the module being roughly equal, and while objects suck in OCaml, but don't suck in Scala, I'm kind of surprised by your judgment.
- tel 11y agoThe module system is the object system fwiw. The things OCaml calls objects are just dynamic row-typed beasties which is why nobody recommends them (except to use as phantom parameters to get your own row typing).