Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"The problem with OOP is that it encourages the proliferation of mutable state."

It should be pointed out that this is a characteristic of the languages and not actually OOP. The original insight, something like "Hey, let's bundle together data structures and their methods into one unit, and communicate with them via messages!" (which got turned into "method calls") actually has nothing to say about mutability. You can and people have build object systems based on immutable objects.

The implications of doing that are deep and profound and color the rest of the system and are beyond the scope of this posting, but it can be done.



This is a great point. Given how I tend to get annoyed when people reflexively associate static typing with Java, I shouldn't be so quick to make the leap from OOP to mutable state. Many OOP concents (e.g. inheritance) are mutability-agnostic.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: