3 ms·
In the right places and for the right reasons they are fine. A lot of code today devolves into what I've come to call "callback spaghetti" and, well, good luck
by robomartin 13y ago
In the right places and for the right reasons they are fine. A lot of code today devolves into what I've come to call "callback spaghetti" and, well, good luck. The toughest thing sometimes is getting your mind around what is supposed to happen and, more importantly, what is not.
I found that sometimes it helps to build a state machine to effectively run the show and try to limit callbacks to setting flags and/or navigating the state tree. State machines make following code functionality a breeze, even when dealing with really complex logic.
- danabramov 13y agoThat's a smooth point! As you probably know, async code is translated by C# compiler to a state machine[1]. [1]: http://stackoverflow.com/a/4047607/458193 http://stackoverflow.com/a/4047607/458193