4 ms·
It's because you want a tasteful mix of both. I believe Scala was pretty ahead here by building the language around local mutability with a general preference
by gf000 1y ago
It's because you want a tasteful mix of both.
I believe Scala was pretty ahead here by building the language around local mutability with a general preference for immutable APIs, and I think this same philosophy shows up pretty strongly in Rust, aided by the borrow checker that sort of makes this locality compiler-enforced (also, interior mutability)
- dionian 1y agoWorth nothing that idiomatic scala uses constants by default, variables are discouraged and frankly rare.