2 ms·
I'm sorry the article left you confused. It did end up a bit on the long side and is probably not as well edited as it could have been. You do not eliminate, o
by chrisvest 15y ago
I'm sorry the article left you confused. It did end up a bit on the long side and is probably not as well edited as it could have been.
You do not eliminate, or even reduce, the amount of logic at work by conflating looping and branching because now, apart from the normal function of these constructs, the language (or its runtime) is also making decisions about which one of these to use when given a particular piece of data.
The truth is that Mustache isn't logic-free, because it has looping and branching, and it can even call methods and functions with its lambda feature. The only template language I know of that is actually logic-free is Rife Templates: http://rifers.org/wiki/display/RIFE/GuideTemplates.html http://rifers.org/wiki/display/RIFE/GuideTemplates.html
What you discover when you use that system, is that templates without logic can't really do much, so you have to control them with logic that sits outside of the templates.
As for destructering, I considered adding a Haskell example, but that idea didn't really work with where I was going with the story on data. In the end I am the most familiar with Clojures destructuring, plus its data story was a really good match here, so I just stuck with it.