When comparing Pug vs XSLT in-browser implementation, the Slant community recommends Pug for most people. In the question“What are the best JavaScript templating engines?” Pug is ranked 18th while XSLT in-browser implementation is ranked 31st. The most important reason people chose Pug is:
Pugs where originally breed for royalty in China, to then be found with royalty in Europe. They were meant only as companion dogs with no other purpose and as such are quit chill. They tend to sleep a lot and are very attached to their owners. While needy at times they are definitely a good breed for those that want a relaxed dog that will spend all of its time with the owner. This also means they are good with children as they tend to be a relaxed dog as well as a bit meaty, in that a small child can not always easily pick it up, which could potentially hurt a smaller more frail dog.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Fantastic companion
Pugs where originally breed for royalty in China, to then be found with royalty in Europe. They were meant only as companion dogs with no other purpose and as such are quit chill. They tend to sleep a lot and are very attached to their owners. While needy at times they are definitely a good breed for those that want a relaxed dog that will spend all of its time with the owner.
This also means they are good with children as they tend to be a relaxed dog as well as a bit meaty, in that a small child can not always easily pick it up, which could potentially hurt a smaller more frail dog.
Pro Permits pipelining
I.e. apply one template on top of another.
Pro AOP model
With ability to split feature implementation apart from main codebase, development became quite more manageable. Example: for data of particular type you could define own rendering or render refine rules; pipelining allows incrementally change UI by adding/removing elements depend of parameters, data values, previously rendered content.
Pro Native multithreaded implementation
Only template engine which utilizes multithreading.
Pro Native pre-compilation available
In some browsers(IE) XSLT during load is compiled into DLL. In others pre-loaded template allows to skip recurring parsing .
Pro Accept native data out of JS heap
XML when stored, saved outside of JS heap, capable to work with amount of data 100x larger of JSON.
Pro Native implementation
Supported in all browsers, starting from IE5.
Pro Server side rendering
XSLT is available as in browser as on server side via various libs including highly optimized for CPU.
Cons
Con Lack of SDLC for in-browser development
It will take time to collect complete gentleman set: debugging, modular development, documenting, unit tests, etc. Please share if know the book on subject.
Con Verbose syntax
Takes time to get used to.
Con AOP model
Is complex to comprehend, justifiable on complex projects.