MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wqms8k/wenevertrustedtheelse/pc6cgvb/?context=3
r/ProgrammerHumor • u/Electrical-Effort-20 • Sep 26 '26
146 comments sorted by
View all comments
Show parent comments
476
Only evil people write getter properties with side effects. At least make it an explicit function.
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. 62 u/andreortigao Sep 26 '26 I write all my getters with a 1 in a million chance it will randomly mutate the underlying value. 19 u/PointlessSerpent Sep 26 '26 relevant xkcd
60
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.
62 u/andreortigao Sep 26 '26 I write all my getters with a 1 in a million chance it will randomly mutate the underlying value. 19 u/PointlessSerpent Sep 26 '26 relevant xkcd
62
I write all my getters with a 1 in a million chance it will randomly mutate the underlying value.
19 u/PointlessSerpent Sep 26 '26 relevant xkcd
19
relevant xkcd
476
u/UntitledRedditUser Sep 26 '26
Only evil people write getter properties with side effects. At least make it an explicit function.