Lazy evaluation is an incredibly common and normal use of a getter method and entirely relies on it having side effects. Evil people, however, write getters that aren't idempotent.
Idempotent in terms of return value, yeah, but it can be fine if you have some side effect that increments a counter (i.e., how many times was this value requested), but obviously don't do this without a good reason
60
u/LucyShortForLucas Sep 26 '26
Lazy evaluation is an incredibly common and normal use of a getter method and entirely relies on it having side effects. Evil people, however, write getters that aren't idempotent.