Although I’ve always agreed on the MVC pattern, specially the separation between the business and the presentation logics, I have to confess that throughout the years, my opinion about using template engines has changed a few times.

Back in 2003, I converted some of the IMP pages to templates and contributed some code to the Horde Templates engine. Back then, I presented some arguments in favor of template engines and one of the main reasons was the ability to send the templates to designers and have them doing what they want with them.

My experience quickly proved that I was wrong. Besides the fact that I added a bunch of lines to the code to define the template variables, the designers still needed a lot of help to customize the templates. Also, the code was slower until a template compiler was developed. Overall, the benefit from all that was null.

Since then, I think template engines are useless for most of the cases. I still agree you should separate business and presentation logics, but you can do it with PHP, you don’t need a different language for that.

Hasin Hayder, the author of a Smarty book, has an interesting post from earlier this year where he says that there’s no need of Smarty anymore:

I just dont need a wrapper over my PHP code which parse regular variable and echo them. Smarty just made itself extremely complex and useless too over the day, seriously.
I seriously don’t think there is need of Smarty anymore. Its dead!

There’s also a lot of buzz around the subject. You can also check the posts from Paul M Jones, and Michael Kimsal.

Tags:, , , , ,