3 ms·
There are no points in the real world, the are things, like chairs. In the real world, if you were to move a chair to the right, the natural way to do it would
by gridlockd 6y ago
There are no points in the real world, the are things, like chairs. In the real world, if you were to move a chair to the right, the natural way to do it would not be to build the same kind of chair at the desired coordinate and then, upon discovering that you do not need the extra chair, to discard it.
Yet, this is how immutable datastructures often work in practice. That may or may not be a worthy tradeoff, but please do not act like it is the right way to do things by default.
- lysium 6y agoI did not say nor act that it is the right way. I think it is easier to reason about code if you cannot (accidentally) represent things that don’t exist in your model, which in my experience happens very easily with mutable state. I used a point as an example.