3 ms·
Why is this better than something like backbone, for instance?
by mkaziz 12y ago
Why is this better than something like backbone, for instance?
- cramforce 12y agoIt could probably be integrated nicely with backbone. This is much more low level.
- michaelmior 12y agoJsAction provides a subset of the functionality provided by Backbone. In terms of how the two handle event delegation, in JsAction, the events are defined in the DOM. With Backbone, you typically define the events in the view which should process them. It's open for debate which is better.
- scotty79 12y ago> It's open for debate which is better. Which is same debate as between onclick and addEventListener only with slightly less verbose syntax on both sides of the debate and some implicit scoping that makes it possible.
- cramforce 12y agoNot a zero sum game though (although I do realize this is hackernews :). addEventListener is sometimes strictly better than using jsaction. i.e. it supports removing event listeners. That is fine. Right tool for the job. onclick-like functionality is coming back to frameworks. Angular and Polymer both have variations of what jsaction provides as a single-purpose library. It is sometimes just much nicer to bind stuff together directly.
- scotty79 12y ago> onclick-like functionality is coming back to frameworks. Yes. I've noticed and as you might have guessed I'm equally deeply astonished and saddened. > It is sometimes just much nicer to bind stuff together directly. Yes. It's so much nicer to have your hammer at your desk than to go to a cabinet to fetch it when you need it. But if you own bunch of tools and do various task at your desk it's either cabinet or a pile on you desk that at some point prevents you from making any progress on your projects. Things should be kept separated out and organised by concern. If they are brought together it is either for convenience or speed. Both perfectly valid reasons so the separation is never strict but should be viewed as exception not as a rule. If you don't watch yourself you might end up with oscommerce PHP source files where everything is together because it's so much nicer to bind stuff directly.