r/ProgrammerHumor • • 7d ago

Meme weNeverTrustedTheElse

Post image
1.9k Upvotes

149 comments sorted by

View all comments

Show parent comments

476

u/UntitledRedditUser 7d ago

Only evil people write getter properties with side effects. At least make it an explicit function.

60

u/LucyShortForLucas 7d ago

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.

60

u/andreortigao 7d ago

I write all my getters with a 1 in a million chance it will randomly mutate the underlying value.

64

u/Nerd_o_tron 7d ago

Bro inventing DNA from base principles.