Everah wrote:The funny thing is that even when using a template parser, my apps still run insanely fast. I have an app that processes three templates, all kinds of conditionals within the templates and a bunch of other things going on and it parses in about .2 seconds. That, to me, is an acceptable time frame.
The performance hit is minimal...I'll agree, but it's nonetheless a performance hit and the slower the machine or the larger the site codebase grows, the more noticable the hit becomes. Obviously on a slick as oil fast server, TL or Smarty for that matter wouldn't bottleneck.
The point is...I'm anal I guess. I can't personally justify the costs of something so trivial when you can reduce those costs by using a *very* similar technique for (arguably) only the sake of clarity.
It's like using double quotes through your code if you don't need to...for the sake of clarity??? What if the string doesn't even have interpolated values??? Do you still use double quotes?
How about caching the value of a count() and using a variable instead of count inside a for loop, etc???
I see these as just as important as following good design, etc...
Coding conventions to me, are equally important, whereas most of you coughed at the idea...abstraction is something I strive for 110% of the time, again, other arguments I've had few could see where I was coming from.
Proper software development (in my experience) comes from experience. Bloat, mixed coding conventions, nonstandard coding practices, poor documentation, lack of comments, etc...
They all add or retract from a solid software system, so I am anal about everything not just one thing...I guess is what I'm saying.
If you can live with knowing your application is only mildly (variably) affected by this library or that and this library or that is only providing trivial benefits easily acheived by other techniques, then so be it.
Consider the following: I can find 50 developers/designers that all agree PHP native template syntax is just as easy to read as Smarty. I can even boast the fact that using PHP prevents any one from having to learn a new syntax, reducing the learning curve. On the flip side, I can also find 50 developers/designers who say Smarty syntax is waaaaaay easier than PHP native syntax. Fabulous, so we have a 50/50 split of opinion.
What I can absolutely promise you however, without a dought, 110% gaurantee, is that using Smarty or TL as a library instead of PHP native template syntax absolutely adds more bloat, more maintenance, more parsing and possibly execution overhead to your entire application as it's likely integrated into every page request.
Using that logic, I figured the choice was easy, but obviously not, going on the amount of rejection or objection I have received on the arguments I have made.
Meh, no biggie...I don't mind competitive advantages
Cheers
