DEV Community

Discussion on: Use Immutable Objects

grinnz profile image
Dan Book

As I probably said back in these discussions, I see it as two distinct types of objects. Objects that represent a "thing", which are best treated as immutable, and objects that represent "state", which should be mutable. I use both of these types quite commonly, so focusing too much on one type seems counterproductive to me (though the points you bring up are very important, and why I love the Time::Moment immutable API).