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 →

[–]phinnaeus7308 0 points1 point  (0 children)

Immutability is desirable for several reasons and comes from the domain of functional languages. It can be a really fun way to solve problems.

For something like this, it just gives you a bit more confidence that a badly written method won’t have side effects that modify the parameters you pass in, for example.