Will Klein
Boston Code Camp 19
March 9, 2013
engineer @ Travelers
github.com/willklein
http://willkle.in
We used to mix our code
(in a blender)
We had concerns, so we separated them
...you get the idea.
Trying new things
Improving the "Developer Experience"
taking HTML (or something like it),
dynamic data (typically JSON),
and binding the data into the HTML.
DOM scripting, the fast way:
Is faster really better?
<a href="somewhere.html">Some link</a>
Released in 2009
Written in Ruby by Chris Wanstrath
Inspired by ctemplate (C++) and et (Erlang)
Ported everywhere
Has a spec
Handlebars.js is a superset of Mustache.js
Hogan is a Mustache compiler
Inspired by Haml (born in Ruby)
Written for Node.js by TJ Holowaychuk
Can be deployed to the browser
*Pure* HTML templates
Written in CoffeeScript by Jarno Keskikangas
DOM based
Semantic data binding
We still need our pages to load (fast)
Some browsers are really slow
Some browsers are really fast
Done right, templating can *improve* responsiveness (perceived performance)
Keep some things server-side
Initial page-load HTML can be done server-side
Hybrid approach
Share templates when possible
Templating can provide:
Questions?
/
#