4 ms·
A templating engine does a few things differently than printf. Typically, it will compile into an intermediate version, for scripting languages like python as a
by dangerbird2 9y ago
A templating engine does a few things differently than printf. Typically, it will compile into an intermediate version, for scripting languages like python as a module or object in the language. Most importantly, it escapes the input to prevent arbitrary HTML injection, for example a user inserting a <script> tag in a blog post content causing the javascript to be evaluated. Often, template engines have features for making it easier to design web user interfaces such as template inherritence and composition so you can share things like layouts, headers, and menus across pages.
- sametmax 9y ago+1. It can deal with non dev creating templates. It can compose templates. Manage caching. Embed logic. Debugging.