3 ms·
Your brain should fire wrong signals when you see mut. I think part of the design of mut is to discourage you from abusing mutable variables. (Personally, I p
by steego 11y ago
Your brain should fire wrong signals when you see mut. I think part of the design of mut is to discourage you from abusing mutable variables. (Personally, I prefer F# forcing you the type mutable).
I'm glad they didn't give it a special prefix because not only would it add unnecessary noise, it would make refactoring tedious. I'd rather give the compiler my intent once, and let it figure out if I violated my own intentions.
One thing I like in the F# toolset is the syntax highlighters will highlight mutable and reference variables different colors. It's a matter of time before Rust developers have that (If they don't already).
- crudbug 11y ago"Discouraging Mutability" with the added "mut" would be a positive way to look at it. Thanks !