OOP's idea to bundle state and the methods that operate on it together into objects is underrated and also nuanced: nothing stops us applying global methods to global state, but we'd need more identifier prefixes. So it's easier to make related methods and state "mutually local".
-
Show this thread
-
Replying to @propensive
Rich Hickey disagrees, saying that's complecting. In Clojure (and not only) the philosophy is that the data-structure survives more than the code that operates on it and it's wrong to tie them together. But I agree w/ you and I like my encapsulation.
3 replies 0 retweets 11 likes -
This Tweet is unavailable.
-
Replying to @dustingetz @alexelcu
But there's another point which is that the state may be *several* values, coupled by virtue of being accessible via a single reference. Encapsulated methods can access any of those values without a prefix, which is subtle but significant convenience.
0 replies 0 retweets 1 like -
This Tweet is unavailable.
-
Replying to @dustingetz @alexelcu
I mean `http://foo.bar ` rather than just `bar`.
0 replies 0 retweets 0 likes -
This Tweet is unavailable.
No, I just mean that a method definiert inside `foo` can refer to `bar` instead of `http://foo.bar `. A method defined elsewhere can't.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.