News for hackers. Stuff that matters.
Re:The difficulty of programming depends on the layer and qu... by jolux on Sunday April 25, 2021 @03:00AM (#26930865)
I find myself making object abstractions more in languages that do not have solid support for functional programming. In OCaml, I can build dozens of useful abstractions off of a handful of small functions by using currying and partial application. Equaling that expressivity in languages that don't support those features requires making objects more often than I would like to, because the alternative is hundreds of overspecialized utility functions that do not compose well and push you towards imperative, stateful styles (I have seen this happen!).

I still stick to two levels of inheritance max though, and most of the time I only use interface inheritance. Rarely do I want behavior inherited.

There are no comments on this comment yet.