Hacker News new | ask | show | jobs
by bsima 745 days ago
Templating engines start out with just variable substitution, but inevitably you want to build logic into your HTML, so it adds if/else statements, then before you know it you are embedding your 'real' programming language into the HTML template itself. Think ERB templates with arbitrary ruby code inside them.

It's more robust to go the other way: start with the full-powered programming language, and emit the static HTML data after doing the complex logic stuff.