-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logicless or not? #1119
Comments
Logicless has not clear definition. I've seen arguments that claim once you have iteration and conditional branches, you are no longer logicless. I'd argue that you don't really have a useful template language with such a strict definition. Handlebars takes steps to avoid the business-logic in templates nightmare that was so often seen in early JSP and PHP days, but we have no control over the code that is run in helpers, by design, so you may argue that that is not logicless. |
@wycats feel free to represent your own comments here :) |
The intention of Handlebars has always been to allow template authors to create their own control flow constructs outside the templating engine, rather than embedding the logic inside the templating engine. The reason for this is that embedded JS drags with it the baggage of the full JavaScript language, while Handlebars helpers are expressly intended to be much more "pure". While I would never force every Handlebars (or Ember) user to understand the concept of purity, creating a new, limited expression syntax nudges people down the right path naturally. One of the nice consequences of this is that it has been easy to port Handlebars to a lot of different languages, because the Handlebars expression syntax is designed to separate the core semantics from call-outs into the host language. This means that other embeddings need to expose a mapping from those call-outs into Handlebars semantics, but that's it. |
Got it, thank you for the explanation. |
Copied from the website at @wycats' request. Addresses handlebars-lang#1119.
I've seen several videos where @wycats mentioned that Handlebars was not intended as a logicless templating engine but README says: "Handlebars.js and Mustache are both logicless templating languages that keep the view and the code separated like we all know they should be".
For the sake of clarity, is this description still accurate?
The text was updated successfully, but these errors were encountered: