AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
Immutability in Object Oriented Languages
In object oriented languages, it's pretty hard to create new objects based on the existing objects. So would you say that in the average application, that the developer should default yo making things immutable? Is that a reasonable default for most developers? I would say so. If it is possible, then you definitely need to default to creating immutable classes by default. It is not always possible. But what i recommend you to instead is if you have some value or a simple class, you can wrap it into a value object, which is immutable.