Better than templates, building highly dynamic web pages
blog.fastmail.fm
Better than templates, building highly dynamic web pages
1–10 of 44 posts
Re: Better than templates, building highly dynamic web pages
#2This is an interesting approach. One downside is that it's much less readable than the Handlebars template. Using Coffeescript for the "templating" functions would actually clean it up a lot.
Re: Better than templates, building highly dynamic web pages
#3My browser does 10,000 operations / second with innerHTML, and 15,000 operations / second with DOM. In every ajax application I've ever made, this is negligible, compared to latency, server processing time, and downloading time.
I guess this saves you 1ms for every 30 elements you create? I'm sure there are some cases I'm missing where this might make more of an impact, but from my understanding of the article, this looks like a pretty small improvement.
Re: Better than templates, building highly dynamic web pages
#4I thought this was going to be about a data binding template system like AngularJS or Knockout. Those are truly "better than templates", whereas this one is questionable.
Re: Better than templates, building highly dynamic web pages
#5I have a problem with this, as it appears to break the separation of concerns.
Don't the programing guru's tell us over and over NOT to mix markup into code and vice-versa?
Re: Better than templates, building highly dynamic web pages
#6That code smells funny.
Re: Better than templates, building highly dynamic web pages
#7I remember back in the late 90s that generating content on the browser using javascript was the new and greatest thing.
Personally it bugs me. But I'm 31, a total fuddy duddy.
Re: Better than templates, building highly dynamic web pages
#8What concerns me about generating HTML clientside is the impact on accessibility (WACG and the likes). How would screenreaders handle these techniques?
Re: Better than templates, building highly dynamic web pages
#9When I do this, I do it with Kris Zyp's put selector [1]. Creates new elements, modifies existing ones. It's the only DOM manipulation API I like besides jQuery.
[1] https://github.com/kriszyp/put-selector
That said, I don't do this very often because the designers I work with prefer templated markup.
Re: Better than templates, building highly dynamic web pages
#10On mobile, if performance is really so good, it might make sense – I especially like having references in place – might be quite handy.