

Ask HN: Event-Driven Programming vs. Object-Oriented Programming - newpatriks

I am a javascript developer. I am new to Event-Driven development &quot;paradigm&quot;, and I have some questions about.<p>I think that EDP and OOP are not at the same level, so I use Object Oriented paradigm behind Event-Driven. But I am not clear what EDP gives to a OOP project: Order? maintenance? scalability? easier to test? Or is EDP just a good architecture solution for those languages that are not OOP natively?<p>I&#x27;ve read that can help with dependency injection too. But this can be sorted out using libraries such as RequireJS, can&#x27;t be?
======
whichdan
It depends on how you want to handle message passing. Would your architecture
be simpler if you could decouple your sender and receiver? It can make it
harder to track errors (as in, where the message came from, determining who is
listening to it, or tracking down circular logic), but it does give you some
very nice options for decoupling. I would strongly suggest looking through the
design patterns used in Twitter Flight, which is a framework based largely on
an evented system.

