2 ms·
But it can be solved trivially with proper discipline. ‘Mutable by default’ implies there’s a way to make things immutable, and proper discipline can make every
by Someone 4y ago
But it can be solved trivially with proper discipline. ‘Mutable by default’ implies there’s a way to make things immutable, and proper discipline can make everything immutable.
The problem is that no human can maintain proper discipline at all times, and it takes only one slip to create a bug.
And yes, programmers doing that would soon realize that ‘immutable by default’ leads to a better UX of a programming language. It’s way easier to be alerted by a warning ‘mutable’ keyword than by a missing ‘immutable’ one)
That’s why we should have linters that flag all missing ‘immutable’ annotations or incorrect usage of ‘mutable’ ones. Rust even adds something like that to the language.