←back to thread

475 points danielstocks | 1 comments | | HN request time: 0.235s | source
Show context
cblconfederate ◴[] No.27301548[source]
I m sure it s not random but somehow systematic
replies(3): >>27301978 #>>27302182 #>>27303119 #
bellyfullofbac ◴[] No.27302182[source]
Reminds me of a colleague implementing "emailRecipients" as a field in a singleton service. The first online order got an order confirmation mail, and when a second online order came s/he also got their confirmation mail (the field just grew and grew...).
replies(1): >>27302446 #
andix ◴[] No.27302446[source]
One more reason not to make singletons.
replies(3): >>27302713 #>>27302797 #>>27303015 #
1. showsover ◴[] No.27302713[source]
To be fair singletons are pretty useful. You just have to understand that they're not made for mutating state.