logoalt Hacker News

jaxxzi • today at 7:00 AM • 2 replies • view on HN

I've never quite got the deal with 'template engines'. I have always just done normal programming - in whatever language I'm using - and interspersed outputting raw string literals to create the html.


Replies

chii • today at 7:01 AM

and this leads to html injection attacks when there are small errors in your escaping.

Using a template engine means you systematically ensure that values are escaped (at least, that's one of the reasons i would choose an engine over raw dogging the html).

➕ show 1 reply
NamlchakKhandro • today at 7:12 AM

eww gross.