News for hackers. Stuff that matters.
Re:Backbone UI by joestelmach on Tuesday June 19, 2012 @08:18AM (#4131378)
Thanks for sharing your viewpoint.

I realize that templates are a popular choice for many, but I view them as an unneccesary layer of indirection. Sort of like printing out an email, hand writing a response, and scanning it back in as a reply. Once your markup has been converted to a document object model, why not embrace it?

Re:Backbone UI by crazygringo on Tuesday June 19, 2012 @09:59AM (#4131815)
I think it's kind of like the difference between writing in assembly and C.

Using a bunch of calls to appendChild() and setAttribute() results in code that is difficult to read, because it's so low-level. You can't "see" the generated HTML, just like in assembly you can't really "see" the code structure.

Whereas using templates lets you "see" your HTML, with an easy-to-understand structure. So it's the natural, default choice for ease-of-use and maintenance.

Re:Backbone UI by TazeTSchnitzel on Tuesday June 19, 2012 @11:36AM (#4132374)
Well, one style is imperative, one is declarative. Some prefer the former, some the latter.

Myself, I much prefer imperative.

Re:Backbone UI by sunkencity on Tuesday June 19, 2012 @01:44PM (#4133096)
I really like this style of templating, it's pretty close to how Seaside generates it's HTML, but more direct since it manipulates the dom directly. Also using the DOM directly is very fast.