3 ms·
Everyone thinks they are can be the first to do something, and that there is surely nothing that will happen before them. Unfortunately everyone save for one is
by saagarjha 2y ago
Everyone thinks they are can be the first to do something, and that there is surely nothing that will happen before them. Unfortunately everyone save for one is mistaken. Sometimes that chosen one is not even consistent.
- wizzwizz4 2y agoIf everyone is responsible for maintaining the illusion that someone else is first, who's actually first is largely irrelevant.
- hinkley 2y agoThis is one of the problems with Singletons. Especially if they end up interacting or being composed. In Java you’d have the static initializers run before the main method starts. And in some languages that spreads to the imports which is usually where you get into these chicken and egg problems. One of the solutions here is make the entry point small, and make 100% of bootstrapping explicit. Which is to say: move everything into the main method. I’ve seen that work. On the last project it got a little big, and I went in to straighten out some bits and reduce it. But at the end anyone could read for themselves the initialization sequence, without needing any esoteric knowledge.