In the mid-late 90s, when I started writing C++, I had a gut instinct that methods and data shouldn't be encapsulated together. I couldn't explain why though.
Rich Hickey started clarifying it for me a little though. I can't dig up the interview he did, but he talked about classes being mini-DSLs and hindering reuse. That makes sense to me.
I much prefer generic functions and multi-dispatch in Common Lisp's CLOS and the new language Stanza - it just seems more flexible.
But generally, I want to think about data transformations and not little "machines" (objects) doing things things to their state internally.
Rich Hickey started clarifying it for me a little though. I can't dig up the interview he did, but he talked about classes being mini-DSLs and hindering reuse. That makes sense to me.
I much prefer generic functions and multi-dispatch in Common Lisp's CLOS and the new language Stanza - it just seems more flexible.
But generally, I want to think about data transformations and not little "machines" (objects) doing things things to their state internally.