When comparing Underscore Templates vs Dust.js, the Slant community recommends Underscore Templates for most people. In the question“What are the best JavaScript templating engines?” Underscore Templates is ranked 7th while Dust.js is ranked 9th. The most important reason people chose Underscore Templates is:
Due to Underscore's optimized performance and ease-of-use it can be deemed as most fit for use in small sections of your code, where you just want a quick and simple template to render your content.
Ranked in these QuestionsQuestion Ranking
Pros
Pro For micro templating
Due to Underscore's optimized performance and ease-of-use it can be deemed as most fit for use in small sections of your code, where you just want a quick and simple template to render your content.
Pro Pre-compilation
Underscore allows you to compile your template once before data is inserted to it.
Pro Filters
Easily extendable using filters and helpers. Can consume any public API.
Pro Cache templates at the client side
Dust.js compiles its templates to plain old javascript, and since javascript files are cacheable, that essentially means your templates can be cached at the client side.
Pro Write once run anywhere
Since Dust's templates are written in JS, there's nothing stopping you from running the same DustJS code both on the client as well as server side (if it supports V8/Rhino JS engine).
Pro Interactive tutorial
Dust.js is quite easy to begin with, thanks to it's powerful interactive tutorial.
Cons
Con Not a true templating engine
template
in underscore is simply a function which compiles a piece of template into HTML. It's useful for rendering HTML from JSON and it's not very useful when building complex frontend templates.
Con There are no new releases
And apparently Linkedin will not support it more.
Con Not enough community support
Since the number of people currently using Dust.js is quite insignificant as compared to Mustache js and Handlebars, you're less likely to get your question answered or issue resolved if you start using it.
![Vetted.ai illustration](/images/ai/vetted-illustration.png)