3 ms·
> If you have 10mb of numbers that you need to add 1 to, immutable state means you now have 20mb of numbers guaranteed. Immutable state also means that you don
by marcosdumay 13y ago
> If you have 10mb of numbers that you need to add 1 to, immutable state means you now have 20mb of numbers guaranteed.
Immutable state also means that you don't need to add 1 to the numbers you won't use, and that you can discard the old numbers if you only wanted the incremented ones.
Garbage colletors and run-time optimizers are added complexity, and may be too much for an embbebed system (or maybe not, controlers are getting bigger each day). But that's a context dependent conclusion, not a certainty.