Re:Threads Are a Bad Idea for Most Purposes (1995) [pdf]
by adev_ on Tuesday January 28, 2020 @04:03PM
(#22173994)
> Event-driven programming is way less painful than Java threads. With threads, in every place you mutate anything you have to ask yourself, "what happens if my thread is preempted here?"
Event-driven programming is a different pain in the ass but still a pain in the ass.
The current status of the Web speaks for itself: it's event-driven based JavaScript, and it's full of state/transitions bugs everywhere.
In event driven you trade concurrent r/w access issues for a loosing execution contexts issues and out of order issues. The result is often a mess of spaghetti callback close to unreadable.
The less worst of the world might be simply a proper coroutine system, which seems to come to almost every programming language after 30 years of existence
Event-driven programming is a different pain in the ass but still a pain in the ass.
The current status of the Web speaks for itself: it's event-driven based JavaScript, and it's full of state/transitions bugs everywhere.
In event driven you trade concurrent r/w access issues for a loosing execution contexts issues and out of order issues. The result is often a mess of spaghetti callback close to unreadable.
The less worst of the world might be simply a proper coroutine system, which seems to come to almost every programming language after 30 years of existence