3 ms·
edit: of course I meant that cloning isn't a consideration in IMmutable languages and that JS is NOT very good as a functional language... oh boy. Annnd anothe
by sodapopcan 4y ago
edit: of course I meant that cloning isn't a consideration in IMmutable languages and that JS is NOT very good as a functional language... oh boy.
Annnd another nice thing is consider code like this:
perform_some_action_with_object(user)
user.i_hope_user_hasnt_changed()
In mutable languages we can't be sure that `perform_some_action_with_object` doesn't mutate `user` so we have to check. This isn't even a consideration in immutable languages. Again, not the biggest problems in the world, but it really helps when you want to quickly scan through a codebase you are unfamiliar with. You could also say "don't write code like that" and I tend to agree, but I have seen a lot of code like that in OO codebases in my time.
I made sure to double check my spelling this time :D