Hacker News new | ask | show | jobs
by soulbadguy 3282 days ago
> You say that as if these things are not just as easily expressed in FP

No, that's what you read. What i said what was i wrote... OOP is bigger than inheritance.

> -- if not even easier.

Again, this kind of statement really sound like empty FP propaganda to me.

> Encapsulation is just "abstract data types", e.g. ML modules with abstract members, or non-exported data constructors in Haskell. Another option would be simply closing over whatever you're trying to hide. Another option would be existential types. (There's some overlap among all of these.)

Or "abstract data types" is just Encapsulation...

1 comments

> No, that's what you read.

I think you may have misunderstood my intent. I was just trying to say "FP can do these things too".

> Again, this kind of statement really sound like empty FP propaganda to me.

Right, so any type of even very modest support for X is "empty X propaganda". Can we please assume at least a modicum of good faith here?

> Or "abstract data types" is just Encapsulation...

Oh, so "semantics" it is then. Oh, well.

FWIW, I think I'm right in saying that ADTs were invented quite a bit before OOP & "Encapsulation".

I notice that you also didn't answer my question of what Composition actually means in OOP. Do you have an answer? I promise, I wasn't being facetious.