2 ms·
If you truly need an immutable list there's no shortage of them available. It's more a "is this such a strong, common need that everyone must have it?" So far
by kllrnohj 8y ago
If you truly need an immutable list there's no shortage of them available. It's more a "is this such a strong, common need that everyone must have it?"
So far I've never needed guaranteed immutability, I've just used kotlin's List (which is an immutable view). If that's the only thing anyone gets then it's functionally guaranteed immutable even though it's not sitting on an immutable implementation.
- lmm 8y agoIt's not a case of need versus not; it's that all your lists being mutable creates an extra cognitive drag on everything you do. It's one extra possibility to think about when debugging and trying to understand what's going on when something "impossible" happens (which is what a lot of bugs look like when you're investigating them), right when you can least afford to spare any extra brainpower. (Kerrigan: Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.)