NYCPHP Meetup

NYPHP.org

[nycphp-talk] Smarty

David Sklar sklar at sklar.com
Wed May 19 09:31:55 EDT 2004


> Just read David Sklar's  "Essential PHP tools". It serves as a great 
> reference for Pear DB, Auth,HTML_Quickform etc.. I don't even know him, 
> so I'm not being biased.

Thanks!

> But I was curious about people's feelings of Smarty. Do most think this 
> extra processing is worth it? A conscientious job of keeping logic and 
> presentation separate would accomplish this as well. Any feelings?

I think Smarty is a helper in that "conscientiousness" department. If 
that help, for your project or company or whatever, is worth the 
performance tradeoff, then Smarty is a good idea.

There are plenty of ways to boost Smarty's performance (caching, using 
an accelerator), so you can minimize the performance hit. And, to be 
completely honest, most web sites aren't running at the level where 
every last bit of performance is so crucial.

A legitimate downside to Smarty is that you need to learn, essentially, 
another programming language -- Smarty's syntax for variable 
interpolation, its function names, etc. But if that syntax is easier to 
grok for your site designers, then that's a good thing.

See also Adam's spot-on mini-rant a little while ago about including 
human time spent and programmer convenience in your calculations of cost 
and performance. Smarty's advantages definitely fit into that category.

> Also, any feelings about DB and whether there is a big performance hit? 
> Also, does it work well with stored procedures and other RBDMS specific 
> goodies?

I think the big win of DB is that it provides a unified API for database 
access, not so much that it abstracts SQL features whose implementations 
vary across databases. Whatever database program you're using, 
DB::query() sends a query off to the database and (perhaps) returns a 
result handle. The contents of that query can be standard SQL, 
vendor-specific SQL, a stored procedure, whatever you want.

David




More information about the talk mailing list