Meta Refresh 2014

On the construction of user interface on the web

Benjamin Lupton

@balupton

Why templating engines suck. A history lesson.

Submitted Jan 7, 2014

JavaScript Today: EJS/Eco/ECT, that was soo 2 years ago. Moustache/Handlebars, that was soo 6 months ago. Facebook React, that’s the new hotness.

PHP 5 Years Ago: PHTML, that was soo 2 years ago. Smarty, that was soo 6 months ago. Symfony/Zend Templating, that’s the new hotness.

PHP Today: Templating engines suck.

JavaScript 5 Years From Now: Templating engines suck?

Is EJS the new PHTML? Is the Handlerbars the new Smarty? Is Facebook React the new Zend Templating? Did we not learn from our mistakes? Are we doing things wrong? Are our choices going to bite us on the bum? This history lesson of templating engines proposes where the different solutions came from, in a way of researching if we are making progress, or reinventing the same broken wheels we’ve had before.

Outline

People seem to have forgotten the lessons of No Smarty a campaign against Smarty, the templating god of the PHP Templating World, back then. Because of this campaign, many people realised that the problems that Smarty set out to solve, weren’t being fixed, or which solutions added new problems.

I’d like to take this talk as a history lesson of how templating engines have developed over the years. I did a paper on this many years ago as part of a school assignment, and also developed jQuery Smarty, the first reactive templating engine for JavaScript in 2008. After implementing that, and using it in a few projects at the time, I started to realise, that implementing Smarty in JavaScript, even with awesome reactivity, wasn’t solving the right problems in the first place. It just improved the broken wheel we already had, rather than fixing it.

We’ll cover the flow chart of templating engines, what problem they set out to solve, whether they did, how they did, and what new problems their solutions caused, and then the new projects which tried to solve those problems. We will then go over proposals of what clean solutions could look like.

We’ll answer questions like:

  • Which templating engine should I use?
  • Which templating engine is the best?
  • How did templating engines end up in the mess they are in?
  • What are the different types of templating engines available to me? and what are their problems?

Requirements

Beginner JavaScript and HTML Knowledge

Speaker bio

Benjamin started off writing C#.NET programs to generate static websites, then moved onto PHP with Smarty, and then progressed onto Zend Framework and Symfony. In 2009 he quit PHP and embraced JavaScript full-time, having had great success with his jQuery Plugins:

jQuery Smarty, the first reactive javascript templating engine
jQuery Lightbox, the first lightbox plugin for jQuery

  • jQuery Sparkle, a don’t-repeat-yourself plugin/effect framework with consideration for AJAX websites

Now he has moved on from jQuery plugins, and has become the founder of Bevry, a company in Sydney dedicated to empowering developers everywhere. His new open-source javascript and node.js projects are some of the most popular in the world. He still works with jQuery, with Backbone and MicroJS like frameworks. You can read more about his approach to client side development here (advanced).

Comments

{{ gettext('Login to leave a comment') }}

{{ gettext('Post a comment…') }}
{{ gettext('New comment') }}
{{ formTitle }}

{{ errorMsg }}

{{ gettext('No comments posted yet') }}

Hosted by

Meta Refresh is an umbrella forum for conversations about different aspects of design and product including: UX and interaction design CMS, content management, publishing and content marketing Information architecture more