There has been some chatter in the web development corner of the blogosphere on the question of whether template engines are necessary.
Those writing the obituary contend that template languages, such as Smarty, were created during a time when website developers didn't have the means to maintain a clean separation between application/business logic and presentation.
Frameworks that implement the Model/View/Controller (MVC) design pattern, they argue, provide this separation for free, so page designers can safely lay out their pages in the underlying language.
The proponents make an interesting argument, and they are probably right if you take into account only those websites that are designed by internal (or very well trusted parties). But that isn't an all-encompassing assessment because it neglects software-as-a-service (SaaS) applications.
A flexible web service application needs to provide a way for end users to customize the look of the site, be it a matter of corporate preferences or branding for customer-facing features. Moreover, customers may demand a high level of control that goes above and beyond a limited bank of radio buttons, input fields and check boxes.
To satisfy a deeper range of customer needs, you have to provide a fine-grained interface for control. But if you're the one developing the hosted application, the idea of letting a customer specify this using the language you use internally opens up the possibility of a security nightmare because that language may give the user a high degree of access to the system.
A well-designed template language can help protect the application developer's assets while giving the customer the means to accommodate their tastes.
To be fair, there are many template languages that have the same security issues as a full blown development language, so in that sense, mainstream template engines may well go the way of the buggy whip. The bottom line is that template languages will still be needed in the SaaS world, but they might be developed in house.

