4 ms·
First: code that performs simple sequential steps should look simple. With callbacks, it always ends up looking complicated. Second: refactorability in callbac
by molf 13y ago
First: code that performs simple sequential steps should look simple. With callbacks, it always ends up looking complicated.
Second: refactorability in callback oriented code is a lot worse than linear code. Even refactoring code with a single callback can be annoying. Async code with callbacks that looks and feels like imperative synchronous code is an enormous gain.
- marcosdumay 13y agoCode that performs simple sequential steps should be synchronous. Keep the asynchronous complications at the code that perform non-sequential steps. And yes, I'm fully aware that some libraries (Javascript's one, the guilty are always the same few) force you to use asynchronous calls. That's a flaw of the library.
- Tloewald 13y agoFirst: you're hammering the async point, which I don't disagree with. I am just pointing out that you can write less horrible async code than the example cited with callbacks. Second: wait until people write ludicrous numbers of async routines as if they were imperative because it's so easy. Calling one from another (and hooking them up to event handlers). You'll have the same damn problem one level removed.