I have just recently started playing with event-driven architectures, coming from a pretty standard object-oriented mindset.

The first thing I noticed was that the difficulty in understanding and tracing through programs seems to increase exponentially with the size of the program. While small pet projects are easy to follow, it feels like the code will rapidly turn to spaghetti.

I understand that I am new to this development mindset and not all of my object oriented worries carry over. Are there any resources on writing maintainable, understandable event-driven code? What do people who use node.js or Twisted or Event Machine do about this?


Solution 1:

I did a talk on this topic at Yahoo last year.

Solution 2:

Try to look at these articles:

  • Understanding the node.js event loop
  • Control Flow in Node
  • Control Flow in Node Part II