by aatd86 · 3y ago · 0 comments
With mutability, it's still possible to make things immutable if properly encapsulated.
If everything is immutable by default and you need mutability for some reason, good luck.
The heuristic is simple too. If you need something to be mutable, you should deal with pointers. So *Player and []*Player here.
At the type/variable level, it's the opposite. We see it with const. Once it's in here, it's in there.