View Single Post
Old 03-18-2010, 03:25 PM  
Varius
Confirmed User
 
Industry Role:
Join Date: Jun 2004
Location: New York, NY
Posts: 6,890
Quote:
Originally Posted by BestXXXPorn View Post
The only logical answer to that is if you prefer the syntax of the inner templating language (in this case Smarty)... However, you must then admit that you are then making your development decisions based on personal preference rather than performance and accessibility/readability for others...
It IS a personal preference, however it's been my experience the Smarty syntax IS easier to understand and offers quicker readability than PHP for many non-coders. It's obviously not the case for all, such as the OP of this thread, but I've seen more than a few coders (our own in-house staff for many years) who all much preferred working with Smarty and thus, were more productive in the end.

I'll give you two examples where I have found Smarty to be more useful.

The first, is in creating multi-lingual websites. I have used a few different ways with Smarty and used or seen dozens of methods in PHP over the years. After all is said and done, I find the easiest and easiest/quickest for translators to work with is through use of the config_load Smarty function. That can be replicated in PHP of course, but isn't AS simple (to non-coders).

The second, was when we allowed affiliates FTP access to modify their co-brands, which were Smarty templates. We limited the tags they were allowed to use to a select few tags and found a lot less people had trouble customizing and using those default template sets than if we had direct PHP pages (and the extra work on our end to ensure they weren't inserting bad code, etc...)

As John said above, he likely found a good reason why Smarty is better for them than straight PHP.

So I think we can all agree Smarty does add another layer over PHP, will never be AS fast (though I still think all things considered this aspect is negligible even on huge web infrastructures), but where you and I disagree is that you think Smarty is COMPLETELY USELESS while I believe it HAS ITS PLACE/ADVANTAGES.
__________________
Skype variuscr - Email varius AT gmail
Varius is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote