In my never-ending quest to solve this whole "concurrent programming" and "networking" thing, ran into Martin Sústrik wonderful blog. This article and the previous one are great arguments for event and state driven designs over callback based systems.
G+: In my never-ending quest to solve this whole …
(+1's) 2
Are you signed up for the Coursera Reactive Programming course? They should be focusing on this theme - its run by a guy from Microsoft and two from Typesafe. Eric Meijer is big on the Actor model, and typesafe obviously are, too. I'm guessing you use a Linux based stack, so the MS tech is probably less interesting. I doubt it will receive much more than a mention in the course, but Reactive Extensions is pretty cool.
Funny how he doesn't explicitly mention the Actor model... It seems he will, though, because he references Joe Armstrong (Erlang) in one of the comments.
I haven't, though I really should. Really want to keep myself brushed up on some of the more theoretical aspects of programming that you don't get to do so much in a day-to-day software engineering job. And while it's true I'm more of a Linux/Unix guy, I'm more interested in the theory rather than the platform (for example, I wish Linux had proper unified asynchronous I/O model like I/O Completion Ports).
Has anyone ever said that callbacks are a good idea?
+Jonathan Newnham , the Node.js crowd seem to think it's the bees nees
Some people think they're a great solution - and for small scale problems they can get get you out of a tight place and probably make sense for some low level implementation.
I think the main problem is they don't scale very well abstraction wise (the callback is done on the callee's terms) making it harder to reason about code and quite often they're used as a quick-fix hack for getting around software layering or abstraction problems ("I need this thread of control right up the top of the stack!"). In that way I don't think it's completely unfair to compare them to goto statements.
I think the main problem is they don't scale very well abstraction wise (the callback is done on the callee's terms) making it harder to reason about code and quite often they're used as a quick-fix hack for getting around software layering or abstraction problems ("I need this thread of control right up the top of the stack!"). In that way I don't think it's completely unfair to compare them to goto statements.
+Reuben Bond Also, why have I not heard of this "Reactive Programming" before this week? (And now seeing it all the time - Thanks human psychology!)
Typesafe have been making a big push lately, so there's a lot more media about it. They made the "reactive manifesto", for example, and this coursera course. Plus Microsoft folk like to talk about Rx, which is a fluent, declarative way to process streams of events (LINQ over async streams, basically) - very nice.