News for hackers. Stuff that matters.
Re:"Study Functional Programming or Be Ignorant" by weavejester on Wednesday June 30, 2010 @04:38PM (#1476136)
Mutable state does not necessarily mean OOP.

For instance, in Clojure I could write a multimethod that updates refs of type Student, and Course:

    (defmethod assign [Student Course]
      [student course]
      (alter student update-in [:courses] conj course)
      (alter course update-in [:students] conj student))
There is polymorphism and mutability here, but we're not dealing with objects.

So to rephrase my question: what are the advantages of OOP when dealing with mutable state?

There are no comments on this comment yet.