Just curious, why did you guys decide on Smarty for Interworx template

OK guys, just curious, why dya choose smarty?

It is an industrial strength template engine I know but its apparently not associated with the word fast. I would have used Templatepower to achieve maximum speed. I know that you have your own reasons for using Smarty, would appreciate if you can chime in and toss in your 2 cents. :stuck_out_tongue:

Roy,

To be honest I had never heard of TemplatePower until your post. I just did some reading and it looks good. Smarty allows for more programatic templates then TemplatePower does it seems (use of for, if and other control flow constructs). There wasn’t much else out there that did all that we needed when we got heavy into PHP development 5 or so years ago so Smarty has just stuck and I will say that it saves our butts on a daily basis with the power it gives.

Regarding its speed I have yet to find the speed of the iworx-cp interface sub-optimal. We don’t use much of the built-in speed tweaks that smarty provides for various reasons but as we optimize the product we’ll be testing them all along with other speed tweaks.

As it usually goes with these kinds of things you just get used to some tools and changing is hard. I’m sure TemplatePower is good, but changing to any new system would mean time not spent on iworx-cp itself and Smarty has done well for us through the years :).

Not the clearest anwer you were probably hoping for, but I tried.

Chris

Hi Chris,

Thanks for the prompt reply.

Templatepower is just a reborn of the Fasttemplate, one of the oldest template engine. Its fast as hell but it covers only the basic necessities unlike smarty which has everything covered at the expense of an insignificant amount of resources.

I wasn’t expecting you guys to switch to other templating system. It is probably just a waste of time. My objective was finding out why you guys used Smarty.
Before you clarified, I had this picture of you guys at a meeting using a dartboard to decide on which template engine to use.
JK :smiley: :smiley:

You mean back when it was just Chris and Paul working in a garage? :smiley:

Tim

PS if you don’t get the refference take a look at:

http://nexcess.net/about.php

There is something magical about garages I tell you.

I wasn’t expecting you guys to switch to other templating system. It is probably just a waste of time. My objective was finding out why you guys used Smarty.

Honestly the higher level functions sold us. They obviously incur overhead but they make our lives easy enough that it’s worth it. And as I said above we haven’t gotten to the point where we notice the overhead at all.

There’s a lot of things in smarty I like a lot. The {cycle} contruct for doing alternating row colors is nice. The {truncate} function which takes a variable and can truncate it to a set # of charaters with trailing ellipsis as well is nice.

Just doing variable substitution doesn’t separate the logic from the template enough (at least for me). The fact that we can work on the data in the template makes things nice.

That said, learning smarty is like learning a programming language and if you have designers that simply design and want content to be plopped in via substitution then smarty may not be your best bet since it adds the overhead of the syntax parsing etc.

And yep, those damn garages, always keep you thinking when you’re in them :).

Chris