4 ms·
The blog appears to be down. You can also read it at https://github.com/kjbekkelund/writings/blob/master/published/views.md https://github.com/kjbekkelund/writi
by kjbekkelund 14y ago
The blog appears to be down. You can also read it at https://github.com/kjbekkelund/writings/blob/master/published/views.md https://github.com/kjbekkelund/writings/blob/master/publishe... (I'm the author)
Edit: The blog appears to be up again! Hopefully it'll stay up this time ;)
- masklinn 14y ago> No frameworks or libraries are needed, just being strict with how you write your code. No framework or library is needed, but they help. And at ~5k both Backbone and Spine's DOM-management object (resp. View and Controller) provide exactly the behavior (and shortcuts) you talk about.
- kjbekkelund 14y agoI know, the point is just showing that the abstractions themselves are quite simple. I've used Backbone on several projects myself. Maybe I'll add a note at the end. Edit: Added! Thanks. I should absolutely have added that before posting it.
- masklinn 14y ago> I know, the point is just showing that the abstractions themselves are quite simple Aye, absolutely, just wanted to nitpick on that statement: while it is technically true (still the best kind around), it can be... not sure what the word is, not quite misleading but it can cause people to waste time not using a library when a small one would do that job (and others) for them. It's absolutely great that you clearly documented the "pattern" as it is a vital one to retain one's sanity, it's just that this phrase sounded like an unwarranted objection to libraries doing the exact thing you recommend :)
- MatthewPhillips 14y agoCan you be specific on how they help? I've tried them many times and I don't see the fuss. I like bits and pieces of them. Backbone events is nice. I use something similar in a lot of my projects.
- masklinn 14y agoThey provide all the tools TFA suggests/recommends and more[0], strongly shifting incentives towards a view only manipulating its own DOM (which becomes as cheap as or — in some case — cheaper than manipulating the global DOM). [0] for instance both Backbone and Spine provide a declarative mapping of events triggered within a view's DOM to a method of that view, making handling of events arising from one's DOM much easier than handling events from outside; Spine also provides a mapping for sub-elements of a view's DOM automatically setting them on attributes of the view making DOM manipulation itself simpler.