My personal philosophy is that string interpolation should not be used to generate machine-readable code, and template languages are just fancy string interpolation. We've all seen the consequences of SQL injection and cross-site scripting. That's the kind of thing that will keep happening as long as we keep putting arbitrary text into interpreters. Yes, this means I don't think we should use template files to make H…
That's nonsense, unless we go by your idiosyncratic definition of what a template language is ("fancy string interpolation").
> Haml (HTML Abstraction Markup Language) is a templating system that is designed to avoid writing inline code in a web document and make the HTML cleaner.
> Pug – robust, elegant, feature rich template engine for Node.js
> JSX is an XML-like syntax extension to ECMAScript without any defined semantics.
OK, I'd agree that JSX is not strictly a template language.
But in the end, all of these compile down to HTML. Not by string interpolation, but as a language that is parsed into a syntax tree, then rendered into HTML properly with an internal understanding of valid structure.
YAML with templating is fancy string interpolation, it's not a template language (or at least a poorly implemented one).