3 ms·
> To be fair to languages without such great parallelism support: you can do this using asynchronous/event-loop-based code Well you can do with callbacks anyth
by chimeracoder 14y ago
> To be fair to languages without such great parallelism support: you can do this using asynchronous/event-loop-based code
Well you can do with callbacks anything that you can do with channels and goroutines. Go's primary appeal is that it makes concurrent[1] code easy to reason about, not that it enables you to do anything that you "couldn't do" otherwise.
Continuations are just GOTOs, and just like GOTOs, some people love them and some people hate them, but even people who like them can find them difficult in large doses. Goroutines and channels are nice, because they fit the structure of imperative code, whereas callbacks sort of resemble imperative code but "inside out".
[1] Note that I didn't say parallel!