Immutability by default is a great thing, I think. This is one reason I prefer functional languages for a number of tasks (F#, Clojure etc).
The example you provided is a good one and this kind of bug have caused a lot of frustration in some codebases.
Conventions are nice for this, but enforced by the language is much better. It should also be an easy path to take compared to messing with side effects, preferably.
Thank you :). Yeah, it was a surprising amount of time to figure it out.
It's interesting how many good ideas are starting to be forced by newer languages - default immutability being one of them. I'm really looking forward to a day when these "good things" are as common as a language being more readable than assembly.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Immutability by default is a great thing, I think. This is one reason I prefer functional languages for a number of tasks (F#, Clojure etc).
The example you provided is a good one and this kind of bug have caused a lot of frustration in some codebases.
Conventions are nice for this, but enforced by the language is much better. It should also be an easy path to take compared to messing with side effects, preferably.
Thank you :). Yeah, it was a surprising amount of time to figure it out.
It's interesting how many good ideas are starting to be forced by newer languages - default immutability being one of them. I'm really looking forward to a day when these "good things" are as common as a language being more readable than assembly.