3 ms·
I'd argue that pubsub systems are the modern goto, but exceptions certainly come in a not too distant second.
by snovv_crash 3y ago
I'd argue that pubsub systems are the modern goto, but exceptions certainly come in a not too distant second.
- jpc0 3y agoWait I need to hear more about this. How are pubsub systems a modern goto? Genuinely curious since I don't work with them directly that often
- snovv_crash 3y agoIf you give me a high level explanation about why goto is bad I can basically /s/goto/pubsub and it will still hold mostly true.
- smallstepforman 3y agoWhen you wrote pubsub, did you mean “the observer design pattern”? If so, please try to adopt a more formal lexicon and use terminology familiar to more developers. If not, please describe what a “pubsub” is.
- snovv_crash 3y agoNo, I don't mean the observer pattern. I mean publisher subscriber pattern. Observer pattern is fine, because there is still a link between the execution flow; basically any time you register a callback you're using the observer pattern. Pubsub adds a middleware, typically in the form of a message passing framework, so that both publisher and subscriber aren't necessarily aware of each others existence. The publisher throws its data into the framework hoping someone finds it useful, and the subscriber listens for those messages hoping someone is publishing them. Think of it like multithread asynchronous goto of your execution flow, except with a lot more boilerplate.