3 ms·
I find your statement confusing -- you appear to be attempting to argue that "let mutable" vs "let" would have no impact because "var" vs "val" has no impact. B
by lgas 9y ago
I find your statement confusing -- you appear to be attempting to argue that "let mutable" vs "let" would have no impact because "var" vs "val" has no impact. But you point out yourself that there's no cost to typing either in Scala... whereas there's a huge (in context) cost to typing "let mutable" vs "let. If you had to type "constant var foo =" vs "var foo =" (or similar) then presumably average Scala code would have quite a different distribution of mutable vs. immutable values.
- moefh 9y agoThe argument is that whether people choose to use mutable when it's not necessary has nothing to do with being harder to type. In Scala, using mutable is not harder and people still do the right thing.