3 ms·
This isn't just 'imperative, evented programming' though. It gives a clear answer on how to separate your code into concerns, although I agree that there isn't
by felxh 13y ago
This isn't just 'imperative, evented programming' though. It gives a clear answer on how to separate your code into concerns, although I agree that there isn't much forcing you to follow good practices.
The problem with the typical 'jquery-type' programming was that apps were essentially an ad-hoc collection of (sometimes massive) event handlers. I think the problem boiled down to:
* there wasn't much experience and consensus on how to organise javascript code (split it into module etc.)
* the DOM is global, meaning you can register event handlers to anything from anywhere (To make matters worse events bubble up and down the DOM tree)!
It seems like people immediately resorted to extremes to solve these issue - basically trying to abstract away the DOM and even javascript completely - whereas the solution could be something much simpler and subtler.