2 ms·
They also note, in the same section: > Note 2: Try to keep the functional behavior side-effect free, although side-effects such as caching are generally fine.
by rubyn00bie 6y ago
They also note, in the same section:
> Note 2: Try to keep the functional behavior side-effect free, although side-effects such as caching are generally fine.
Personally, and I'm happy to to be wrong, I can't think of any situation where mutating data in a getter is a good idea... in any language ever. Every single time I've caught myself thinking about it, if I take a step back, what I'm about to do is hot garbage and thankfully my hot-garbage-sense caught on.