jQuery Template is fairly simple to learn and use and it's based on jQuery. So, if you're familiar with jQuery, jQuery templates should be pretty easy to pick up. Now, it uses jQuery as its underlying runtime, so we need to have both of them and we'll see that in a few moments when we get into the jQuery template part of the course. jQuery template is good for templates that are simpler or maybe up to medium complexity, on the simpler side of medium. It's a really great templating engine for basic use cases where you don't want to have to write a lot of logic.
And, again, we'll take a look at that later on in the course. But if Mustache doesn't exactly fit your needs, it's pretty easy to extend it for certain scenarios to get it to do what you want. Handlebars is a superset of the Mustache templating system. It's got several nice improvements over Mustache. And it's pretty widely used. And, in fact, templates in Handlebars can be what is called pre-compiled for better performance. And, again, as we get to the Handlebars section, we will see what that means.
And then, there's Dust. Dust is powerful. But it's more complex than the other templating engines. And it's powerful enough that LinkedIn actually uses it. And, in fact, LinkedIn doesn't just use it. They are the people who now have taken over the development of Dust and are continuing to push it forward. It follows an asynchronous architecture. And we'll see what that means as we get into using it. It's got lots of useful helper features. Kind of like Mustache, but it's harder to extend Dust than it is to extend Mustache.
So, each of these four templating engines are really good at what they do. And one of them will probably fit some of the templating scenarios that you'll come across when you're building your data-driven sites. So, that's a quick overview of the engines that we'll be taking a look at. And let's take a look at each one.
- What is templating?
- Defining templates in jQuery Template
- Using simple Mustache templates with sections and conditions
- Adding conditionals and loops to Handlebars templates
- Working with Dust templates