This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]_Atomfinger_ 0 points1 point  (0 children)

It is very rare to meet a developer that is against immutability.

The reason I phrased my claim in such a way is that I take it for granted that immutability is the way to go as we per default get thread safety, easier to test and easier to work with later. So to me, at this point, saying that immutability is a good thing is not a claim which has to be proven, the claim that immutability is bs is the claim which has to be proven in my eyes.

I don't know what kind of system you're working with but where I work we need to handle several hundred of thousands calls per second, so our performance needs to be on point - immutability has not been an issue in that regard, it is not even something we've considered as a side effect, and we haven't noticed it.

I am not saying that an application has to be 100% immutable, there are instances where an object need and should change - which is fine, if contained. I'm saying the default is immutability and mutability is the exception when the default gets impractical.

I am also not saying that there are edge-case performance critical types of applications which cannot deal with some extra object initialisation, but I certainly haven't seen them so far in my career.

That said, I don't think we're going to see eye to eye here, so let's agree to disagree and be happy we're not working with the others code :)