6 ms·
But on the contrary, template languages are useful because it lets you trivially templatize any text-based file regardless of the file syntax (as long as the te
by eridius 11y ago
But on the contrary, template languages are useful because it lets you trivially templatize any text-based file regardless of the file syntax (as long as the template delimiters are customizable, or at least don't conflict with the file syntax). Building HTML? Sure, use a proper builder API. But for almost anything else, templates can be quite effective.
- jasim 11y agoIt is a fair point. But one has to be careful where the balance is. In the beginning, it would be a text file with a few string interpolation in between, which means we insert logic inside content, and it can remain in the native format. But over time, as in the HTML generated for web apps, the balance of content inverses. What begins mostly as some logic inside predominantly static content, becomes some static content inside a lot of logic. At that point, it is best to make code the primary medium.