News for hackers. Stuff that matters.
Re:Why not C++? by zzzcpan on Sunday March 06, 2016 @05:07PM (#11235787)
> If for one of your requests, you've got to evaluate a(); b(func { c(); });, and you want the effects of a, b, and c to happen atomically relative to the evaluation of other requests, you will have to explicitly manage that.

Well, yeah, you define relationships between them explicitly, by nesting event handlers if you want one to happen after the other one. It's just a matter of a habit. You'll get used to it. It's not that different from placing one statement after the other one in an imperative language.

> means calling it directly

Ok, I understand what you mean. It breaks the whole model though. Instead of calling it directly, callback must be "posted" to be executed by event loop.

Although I admit, I made that mistake myself in the past. Luckily, event driven code is very predictable and unit tests were able to caught it.

There are no comments on this comment yet.