4 ms·
> If you need new values you just make new things. > If you want to do an operation on fooA, you don't mutate fooA. You call fooB = MyFunc(fooA) and use fooB.
by MetaWhirledPeas 1y ago
> If you need new values you just make new things.
> If you want to do an operation on fooA, you don't mutate fooA. You call fooB = MyFunc(fooA) and use fooB.
The beautiful thing about this is you can stop naming things generically, and can start naming them specifically what they are. Comprehension goes through the roof.
- ErroneousBosh 1y agoYes, but you can do that without having loads of stale copies of incorrect data lying around, presumably.
- MetaWhirledPeas 1y agoWith techniques like method chaining you can avoid using a constant or a variable and just pass return values around.