At work, we’re going to be redesigning a site that is running Textpattern. As I’ve never worked with Textpattern before, I’ve been brushing up. After about two minutes of reading, I find out that it has it’s own XHTML-style templating language. Textpattern immediately loses a lot of credibility.
The article I was reading rationalizes the creation of Textpattern’s templating language:
Textpattern is aimed squarely at web designers, not PHP geeks or novice bloggers. Its template tags use a syntax that’s identical to XHTML, and thus familiar and convenient for designers.
Templates specify presentation, so they’re written in a style already familiar to a web designer. A PHP-based template syntax might be convenient for software developers, but PHP is a procedural programming language, not a markup language.
Although there are a couple points in these excerpts that are correct (i.e. “templates specify presentation” and “PHP is a procedural programming language, not a markup language”), the logic is just plain wrong. Sure, the templating language has the same “style” as XHTML, but it’s not XHTML. So no matter what other languages (templating or programming) the designer is already familiar with, they still have to learn this new one.
I am a fan of PHP-based template languages for three fundamental reasons:
- There’s hardly anything to learn if you’re already familiar with PHP (a lot of people are, even “designers”)
- If you aren’t already familiar with PHP, you learn a useful language
- PHP is very well documented (unlike some of these templating languages)
And even if you’re hell bent on creating an XHTML-style templating system, why invent a new language? Because it’s fun is not a good reason. There’s lots of popular languages already out there. Perl’s HTML-Template is a good example.
So, unless you’ve come up with some innovative templating syntax, writing a new templating language is not only reinventing the wheel, it’s just plain dumb.