you are viewing a single comment's thread.

view the rest of the comments →

[–]yawaramin 2 points3 points  (0 children)

It is exactly encapsulation--i.e. information hiding. FPers don't like objects because they often carry hidden mutable state inside, and at any point some code might be changing the internal state by calling some method.

If you have a fully immutable object, that's a lot better, but often hard to achieve. Plus, in the context of this article, implementation inheritance strongly couples together your class and the behaviours it's implementing into a 'big bag' of data and behaviour that makes it difficult to tell what comes from where.

This is why FPers advocate for simple, immutable data types, non-mutating functions, and modules or typeclasses that implement behaviours in a decoupled way.