I am using Node.js and am confused between Jade and Handlebars. Which one should I go for?
JADE.. never mind how messy it looks when the no. of lines crosses 100. but if u know what space(indentation) does to a tag, JADE is simply a piece of cake.
I use Handlebars but in the front, as MVC with Backbone+Marionette. I like that it's very flexible, and using helpers is straightforward. I like also the partials to mix views in the front and you can pre-compile it to be faster or compile it on demand in the browser.
I'm aware that you can use it in the back, but I prefer the MVC in the front approach.
It's very simple to use and understand. I don't want to learn a whole another language (if it's not simple) to write code in it which will get compiled to a language which I am very familiar with.
Haven't used Handlebars but have used few others eg. Twig/blade etc.
I use Jade at the server-side, but not for generating dynamic HTMLs. I use it to generate static HTMLs (ie, they are generated at build-time as opposed to run-time). It works great for me:
You should be able to achieve the same using Handlebars, but if you like your code to be compact, you should choose Jade.
I suggest you give both of them a try and pick whichever feels comfortable for you. Neither of them will take you more than a couple of hours to master.
Since I came from Django, Flask background, I liked nunjacks. It's simple and easy to use (probably because I knew jinja2)
Although Jade is powerful, it can get extremely messy on larger projects and the indentation causes the pages to be difficult to read. Handlebars isn't exactly brilliant but from my own experience, I'd choose Handlebars over Jade.
Lee Penkman
http://how.nz
Remco Boerma
CTO@NPO, python dev, dba
Web2py built in (but optional) templating. It's full python that allows me to do everything i want, in the same language as the rest of my project. Don't know for Node.js though.