Hacker News new | ask | show | jobs
by gf000 478 days ago
I think it's an interesting distinction, but it's sort of OOP's main thing to encapsulate the local (possibly mutable) state, so that using an object externally will leave the inner state correct.

I think the primary issue here is that synchronized should be the default case, with optionally lifting that very strict restriction for multi-threaded access.

Nonetheless, objects with methods that would do STM on their inner state would be a pretty cool design.