3 ms·
> a great many authors cite encapsulation to be the definite trait of an OO language Yes this is what I was referring to, Clojure is not OO in the way that man
by hellofunk 10y ago
> a great many authors cite encapsulation to be the definite trait of an OO language
Yes this is what I was referring to, Clojure is not OO in the way that many think of OO.
But your other points are right on.
- pvdebbe 10y agoBut what exactly is achieved with information hiding, hmm? :) Now there forms many schools of opinion, and in many of them it suffices to have data immutable and value-like, and suddenly it doesn't matter if the information is hidden into opaque memory addresses or not.
- gkya 10y agoYou can make sure that no other bits of code depend on that value being available and thus modify what is internal to the encapsulating unit of code rather freely.
- hellofunk 10y agoYou can still do this in functional programming by programming functions that only interact with their arguments, and limiting what those arguments are. Additionally, in Clojure, you can in fact hide data by not exporting it from a namespace and only providing functions that operate on it in the namespace, and some other FP languages do this also. The difference is that within the namespace/module, all data is available to all functions, which is often easier to think about and organize than adding the complexity of marrying certain data to certain functions.