Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

What is their difference? is TT rendered server side while handlebars client side?
then if TT works with perl structures,what kind of data works handlebars with?json?
and anyway why go for one rather the other?

Replies are listed 'Best First'.
Re: template toolkit vs handlebars
by Corion (Patriarch) on Nov 18, 2017 at 17:02 UTC

    Both are templating systems, and you can use Handlebars syntax with Handlebars templating systems server-side as well.

    The main difference between Handlebars-style modules and Template Toolkit-style templating is that Handlebars expects you to have all data already done as a data structure, while Template Toolkit allows you to pass in objects to the template and call methods on these objects from the template.

    Personally, I've come to the point that I consider baking a data structure much better than passing objects to a template and calling methods on that object, as I prefer most logic to be written on the Perl side of the world nowadays, instead of some ad-hoc templating language with ill-defined semantics and tooling.

    On the other hand, often you have tiny display logic or logic to create special links etc. where methods/callbacks into Perl are incredibly handy.

Re: template toolkit vs handlebars
by Anonymous Monk on Mar 15, 2018 at 20:32 UTC
    In Handlebars client side you can have logic. You can define an Object property and have a get (and set) methods that get called. Object.defineProperty