When comparing swig vs Underscore Templates, 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 swig is ranked 14th. 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 Works both on the client and on the server
Available for node.js and major web browsers
Pro Does not hide HTML
Swig does not abstract HTML syntax from you (like e.g. Jade does) giving a certain filling of control over the markup.
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.
Cons
Con No updates for at least 6 months
Swig has not received any new commits since June 25 2015.
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.
