<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>0xDECAFBAD - Tag: perl</title>
    <link href="http://decafbad.com/blog/atom.xml" rel="self"/>
    <link href="http://decafbad.com/blog"/>
    <updated>2011-11-16T16:29:50+00:00</updated>
    <id></id>
    <author>
        <name></name>
        <email>l.m.orchard@pobox.com</email>
    </author>
    

    <entry>
        <title>Smarty is on my evil list</title>
        <link href="http://decafbad.com/blog/2006/01/08/smarty-is-on-my-evil-list"/>
        <updated>2006-01-08T01:33:47+00:00</updated>
        <id>http://decafbad.com/blog/2006/01/08/smarty-is-on-my-evil-list</id>
        <content type="html">&lt;p&gt;Although I have &lt;a href=&quot;http://decafbad.com/blog/2005/12/18/not-so-deep-php-thoughts&quot;&gt;my grousing about PHP in general&lt;/a&gt;, I have to say that it makes much better template language as-is before pulling something like &lt;a href=&quot;http://smarty.php.net&quot;&gt;Smarty&lt;/a&gt; into the mix.&lt;/p&gt;

&lt;p&gt;At this point, I consider &lt;a href=&quot;http://smarty.php.net&quot;&gt;Smarty&lt;/a&gt; to be evil—though I'm willing to admit that I haven't grokked it fully yet.  And this is coming from &lt;a href=&quot;http://decafbad.com/blog/2005/09/25/templates-good-or-evil&quot;&gt;a templating addict&lt;/a&gt; who has been at times in love with &lt;a href=&quot;http://www.template-toolkit.org/&quot;&gt;Template Toolkit&lt;/a&gt; in Perl,  &lt;a href=&quot;http://jakarta.apache.org/velocity/&quot;&gt;Velocity&lt;/a&gt; in Java, and &lt;a href=&quot;http://www.cheetahtemplate.org/&quot;&gt;Cheetah&lt;/a&gt; and &lt;a href=&quot;http://twisted.sourceforge.net/TwistedDocs-1.2.0rc3/howto/woven.html&quot;&gt;Woven&lt;/a&gt; and &lt;a href=&quot;http://www.owlfish.com/software/simpleTAL/&quot;&gt;ZPT/TAL&lt;/a&gt; in Python.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://wordpress.org/&quot;&gt;WordPress&lt;/a&gt; seems to have put native-PHP-as-templating to good use, so I've already got a favorite for comparison.  But the use of &lt;a href=&quot;http://smarty.php.net&quot;&gt;Smarty&lt;/a&gt; in &lt;a href=&quot;http://www.reblog.org/&quot;&gt;reBlog&lt;/a&gt; rubs me the wrong way.  Of course, &lt;a href=&quot;http://www.reblog.org/&quot;&gt;reBlog&lt;/a&gt; has a lot of highly-abstracted MVC architecture going on.  And this, itself, is something I haven't much in my PHP explorations thus far.  (In fact, I almost hate to see PHP chopped up in this J2EE-esque fashion, but that's another story.  Oh, and &lt;a href=&quot;http://www.reblog.org/&quot;&gt;reBlog&lt;/a&gt; rocks, by the way.)&lt;/p&gt;

&lt;p&gt;But either way, &lt;a href=&quot;http://smarty.php.net&quot;&gt;Smarty&lt;/a&gt; makes this right-handed hacker feel like he's writing with his left.  It seems to have a lot of weird conventions and terminology for which neither knowledge of PHP nor knowledge of other templating systems in general seem much help.  It could just be a learning curve, but to me it seems like an odd &lt;em&gt;sideways&lt;/em&gt; curve at the moment.&lt;/p&gt;

&lt;p&gt;In fact, you know what?  &lt;a href=&quot;http://smarty.php.net&quot;&gt;Smarty&lt;/a&gt; reminds me a lot of &lt;a href=&quot;http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.html&quot;&gt;DTML in Zope&lt;/a&gt;.  I hate &lt;a href=&quot;http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.html&quot;&gt;DTML&lt;/a&gt;—it, also, is most firmly on my evil list.&lt;/p&gt;

&lt;p&gt;Yuck.  Again, it could be just that I haven't known &lt;a href=&quot;http://smarty.php.net&quot;&gt;Smarty&lt;/a&gt; long enough to like it... but yuck.&lt;/p&gt;

&lt;!-- tags: templating php smarty dtml python perl cheetah webdev programming syndication reblog wordpress evil --&gt;




&lt;div id=&quot;comments&quot; class=&quot;comments archived-comments&quot;&gt;
            &lt;h3&gt;Archived Comments&lt;/h3&gt;
            
        &lt;ul class=&quot;comments&quot;&gt;
            
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082526&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://luka.kladaric.net/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=78b0e32da6ce10e17db345a9aa8cde78&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://luka.kladaric.net/&quot;&gt;Luka Kladaric&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082526&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-01-08T11:55:40&quot;&gt;2006-01-08T11:55:40&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;I agree with you... I used Smarty in one project and am now using it in another work-in-progress... and I have to say, the decision to use it with the second was a bad one... Smarty is pretty cool for simple templating, but when you need raw power, it leaves you shipwrecked... I had to turn to some really black magic to get things done... Anyway, a rewrite of the first project is in negotiations and I'm 100% sure I will &lt;em&gt;NOT&lt;/em&gt; be using Smarty there, either.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082527&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://laughingmeme.org&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=01457d1a0f0e533062cd0d1033fb4d7a&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://laughingmeme.org&quot;&gt;kellan&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082527&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-01-08T14:34:57&quot;&gt;2006-01-08T14:34:57&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Agreed.  Using a templating languages with PHP makes no sense. (though I'm not sure the fact that WP does or doesn't do something makes it good design)&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082528&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;l.m.orchard&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082528&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-01-08T15:03:33&quot;&gt;2006-01-08T15:03:33&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Kellan:  Oh, no, WordPress isn't an automatic gold standard for me...  There's plenty that could be better about WP.  (Not having checked out 2.0 yet)  But, I just had a much better time setting up the templates for this blog than I have had in hacking around with templates implemented in Smarty.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082529&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://sporkmonger.com/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=56ee28134dd0776825445e3551979b14&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://sporkmonger.com/&quot;&gt;Bob Aman&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082529&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-01-08T17:41:17&quot;&gt;2006-01-08T17:41:17&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Me, I just wish there was a templating system for Ruby for me to fall in love with.  With all due respect to the Rails people, ERb just doesn't really do it for me.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082530&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://plasmasturm.org/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=e17949267bbfe21a0fadf1bbf00592b4&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://plasmasturm.org/&quot;&gt;Aristotle Pagaltzis&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082530&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-01-08T21:04:14&quot;&gt;2006-01-08T21:04:14&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;&lt;a href=&quot;#comment-3388&quot; rel=&quot;nofollow&quot;&gt;Bob&lt;/a&gt;: port &lt;a href=&quot;http://kid.lesscode.org/language.html&quot; rel=&quot;nofollow&quot;&gt;Kid&lt;/a&gt; to Ruby. :-&lt;i&gt;&lt;/i&gt;)&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082532&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://talideon.com/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=e698f564ac90c4c248f1f678caafd624&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://talideon.com/&quot;&gt;Keith Gaughan&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082532&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-01-08T21:28:05&quot;&gt;2006-01-08T21:28:05&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;What's moronic is that people go to all this trouble building templating systems when all you really need is extract(). Sad, really.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082533&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.ntwizards.net/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=cb564795a1912c36f9fa1399fd22ce29&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.ntwizards.net/&quot;&gt;Bryce&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082533&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-01-12T13:33:10&quot;&gt;2006-01-12T13:33:10&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;PHP as a template engine is more evil than Smarty. The main issue is that template authors may not be trustworthy. Once you include or eval() a PHP template the app is no longer in control and I don't see any way of structuring a PHP app such that it cannot be subverted from within. &lt;/p&gt;

&lt;p&gt;The only defense seems to be using the tokenizer functions to build a PHP parser that validates templates against a &quot;whitelist&quot; of allowed operations. Savant's Restricted Compiler is about the only implementation out there, but it's not quite complete and seems to be more of a proof-of-concept than battle-tested code.&lt;/p&gt;

&lt;p&gt;Whatever Smarty's faults, it solves the untrusted templates problem nicely.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082534&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;l.m.orchard&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082534&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-01-12T14:27:42&quot;&gt;2006-01-12T14:27:42&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Bryce: Oh, I totally understand the implications of offering too much capability to template authors.  That's just how much I dislike Smarty—I'm willing to risk it, rather than put up with that particular implementation.  On the other hand, in my situation, I'm on the same team with the template developers, so we're all on the same team to sink or swim.  I know it's not that simple, in principle, but it covers the 80% of the 80/20 equation.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082536&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://dougal.gunters.org/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=81717a172b6918071fbea1a52483294b&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://dougal.gunters.org/&quot;&gt;Dougal Campbell&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082536&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-01-12T15:25:25&quot;&gt;2006-01-12T15:25:25&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Yeah, I was never able to get into Smarty either, and I've never been able to put my finger on why. Philosophically, I like the idea of using template engines, particularly if you're collaborating with a non-programming designer. I even wrote one (albeit a &lt;em&gt;very simple&lt;/em&gt; one) myself, once. But I've never used any of the PHP template packages that I've looked at.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082537&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://sporkmonger.com/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=56ee28134dd0776825445e3551979b14&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://sporkmonger.com/&quot;&gt;Bob Aman&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082537&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-01-13T01:10:16&quot;&gt;2006-01-13T01:10:16&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Aristotle: When TurboGears first came out, I almost did, believe it or not.  But then I remembered that FeedTools eats all of the time I have available for open-source projects, and I figured someone else would probably do it for me anyways...&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082538&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://plasmasturm.org/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=e17949267bbfe21a0fadf1bbf00592b4&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://plasmasturm.org/&quot;&gt;Aristotle Pagaltzis&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082538&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-01-13T09:02:38&quot;&gt;2006-01-13T09:02:38&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Hehe. Well, I plan to port it to Perl, in any case. :&lt;i&gt;&lt;/i&gt;-)&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082539&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=31475c246f5521e40d92a29ec0e36aa8&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Brian Grayless&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082539&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-01-19T16:00:24&quot;&gt;2006-01-19T16:00:24&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Smarty is really a waste of time. Some food for thought....&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.fudnik.com/main/tiki-read_article.php?articleId=7&quot; rel=&quot;nofollow&quot;&gt;Smarty for Dummies?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just write better code!!!&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082540&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=bdbf6409528370f5549e8470caf6ba30&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Tali Banana&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082540&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-02-01T07:33:41&quot;&gt;2006-02-01T07:33:41&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Well, quite opinionated I see.&lt;/p&gt;

&lt;p&gt;Smarty solves some fantastic problems and the cacheing system is beyond fabulous at this level.&lt;/p&gt;

&lt;p&gt;I've used Smarty on several projects and have been using it now exclusively for 4 years.  Of course, I used others but it was getting sick coming to a new phase in a project and finding out the template system had become RIP....abandoned before their time.&lt;/p&gt;

&lt;p&gt;Smarty has done two great things for me, and I'll speak about them until the day that PHP is abolished:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Smarty has reduced my code to a reasonably sized, scan-able, masterpiece.  Having the logic and presentation seperate is so nice.  I recently rewrote one of my old projects using smarty and all of a sudden it made sense!  No more php in the html and no more html in the php.  And that's something you can't solve without templates for you juniors out there.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Smarty's caching has turned monster db queries into non issues.  Consider this.  A top 10 list from all-time sales.  I'm talking about searching a db with sales spanning 6 years for all items purchased and creating a top sales page.  Easy!  Smarty does it once and caches the results until I decide they need to be refreshed.  Took a 4 second execution time down to less than 0.4 seconds.  And all without having to implement a CMS or otherwise.  Even if you have limitless resources to buy new hardware, caching like this still makes sense.  And the intermediate php/html cache is brilliant.  Everything is so much faster with smarty.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I can't deny, I love Smarty.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082542&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;l.m.orchard&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082542&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-02-01T11:43:36&quot;&gt;2006-02-01T11:43:36&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Tali: I'm usually opinionated, but I try to listen &amp;amp; learn :)&lt;/p&gt;

&lt;p&gt;The benefits you describe with Smarty would seem to come with any decent web development system.  Separating logic and presentation are the general idea behind templating, and some sort of caching is a must no matter what you're using as a presentation-side tool.  My beef is that, out of all the templating systems I've used, Smarty is one of the ugliest.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082543&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=bdbf6409528370f5549e8470caf6ba30&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Tali Banana&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082543&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-02-01T17:30:03&quot;&gt;2006-02-01T17:30:03&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Smarty does need some standards redesign on the interface, as does php itself which has been well documented but slow going.&lt;/p&gt;

&lt;p&gt;Coming from the PERL background and previous php template systems I've been very happy with Smarty in general, even if there are a few things that could be done to speed up the learning curve.&lt;/p&gt;

&lt;p&gt;May be worthwhile jumping on the dev team and making some suggestions.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082544&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://plasmasturm.org/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=e17949267bbfe21a0fadf1bbf00592b4&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://plasmasturm.org/&quot;&gt;Aristotle Pagaltzis&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082544&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-02-02T01:30:31&quot;&gt;2006-02-02T01:30:31&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;But why would you need a template system when you’re already working with PHP, which is itself a template system? Why do You don’t have to have different languages to be able to put the business logic in one file and the display logic in another.&lt;/p&gt;

&lt;p&gt;Perl (not PERL), btw, has the Template Toolkit on the CPAN, which is the spiritual father of Smarty. (And it’s vaguely more defensible in Perl’s case becase Perl is not a template system; though constrated with Perl the deficiencies of TT’s mini language are just all the more painfully obvious.)&lt;/p&gt;

&lt;p&gt;By all of which I mean to say that whether people use languages in stupid ways does not mean the language is the problem; not in either PHP’s or Perl’s case.&lt;/p&gt;

&lt;p&gt;I also don’t see why you need a templating system to implement caching; in fact, having caching coupled with the template engine sounds like a bad distribution of responsibilities. (Indeed, Template Toolkit has no such facilities.) But there’s the Cache::Cache family of modules on the CPAN, which you can use to cache things completely independently of &lt;em&gt;what&lt;/em&gt; is being cached – whether it be the output of a template, or the query results themselves, or anything else, which might not even have anything to do without any output you generate.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082546&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=bab1c370ad7b246023e23e87c8e206c4&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;M.&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082546&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-02-16T14:13:18&quot;&gt;2006-02-16T14:13:18&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;I've good experiences with the Expose PHP template engine (www.kwasd.nl/expose). It doesn't require you to learn a new language, because it uses plain PHP and still offers security, because it contains a tokenizer and, in fact, a small compiler. I used it for some projects and it really offered all I needed. &lt;/p&gt;

&lt;p&gt;And for people who wonder why one would need a template engine: I work with designers and I don't want them to mingle application code. By setting up a shared folder which contains the templates, they can safely work on design and never need to touch my controller or module files. Especially since this template engine has a tokenizer/compiler, they can't call unsafe PHP functions (only those that you, the programmer, register).&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221082549&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://mike.teczno.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=e3b46099c3fd3844c4539b27f143fd97&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://mike.teczno.com&quot;&gt;Michal Migurski&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221082549&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-03-05T23:16:25&quot;&gt;2006-03-05T23:16:25&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Smarty appealed to us because it offered a (relatively) clean way to separate the code from the HTML output. It's definitely got its problems. A large part of the choice was based on my perception of Smarty as having much thought &amp;amp; effort behind it, plus I like the idea of templates caching down to plain PHP. I've done a few PHP projects where I used PHP as the templating language, and frequently succumbed to the temptation to stash app logic into the templates where it didn't really belong. Smarty has a pretty extensive vocabulary, but has (so far) resisted the pull to incorporate more real-language features, like PHP did. It's worth remembering that PHP was originally supposed to be a template language for &quot;real&quot; code to be written in C. &lt;em&gt;shudder&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When we forked Reblog from Feed On Feeds, we were starting with raw-PHP display code mixed in with database calls, and it was a freaking disaster. One of my first design goals was to make it hacker-friendly, clarifying and documenting as many seams as possible so people could make localized changes more easily. I'd like to be using Python under the hood with Smarty on top, though there's a lot to be said for using commonly-known tools like Smarty in apps where you want to encourage modifications.&lt;/p&gt;

&lt;p&gt;And Wordpress.... oh, Wordpress. My eyes roll back in my head when I'm forced to touch its convoluted innards. I pushed hard for a Reblog plug-in API specifically so I could cheerfully deprecate the old-style Wordpress plug-in. =)&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;/ul&gt;
    
        &lt;/div&gt;



</content>
    </entry>
    
    

    <entry>
        <title>Not-so-deep PHP thoughts</title>
        <link href="http://decafbad.com/blog/2005/12/19/not-so-deep-php-thoughts"/>
        <updated>2005-12-19T03:50:25+00:00</updated>
        <id>http://decafbad.com/blog/2005/12/19/not-so-deep-php-thoughts</id>
        <content type="html">&lt;p&gt;You know, not that I've been at it for long, but I've had an long-running observation about PHP:&lt;/p&gt;

&lt;p&gt;As a language and an API, &lt;a href=&quot;http://www.netalive.org/swsu/archives/2004/09/why_php_still_s.html&quot;&gt;PHP kinda stinks&lt;/a&gt;.  It's got more crud than I left behind in Perl, but without all the meta-magic that made it worth it.  And, I get a little nervous tic when I think about it in relation to Python and Ruby.&lt;/p&gt;

&lt;p&gt;On the other hand, it's ubiquitous and cheap—and because it's in the hands of people with all levels of skill, most popular PHP apps have by necessity managed a high standard of easy install and simplicity.  The languages with more meta-magic tend to attract eggheads (myself included) who can forget about keeping things simple.&lt;/p&gt;

&lt;p&gt;And, did I mention PHP is ubiquitous?&lt;/p&gt;

&lt;!-- tags: php webdev perl python ruby --&gt;




&lt;div id=&quot;comments&quot; class=&quot;comments archived-comments&quot;&gt;
            &lt;h3&gt;Archived Comments&lt;/h3&gt;
            
        &lt;ul class=&quot;comments&quot;&gt;
            
        &lt;li class=&quot;comment&quot; id=&quot;comment-221083537&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.whump.com/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=152a649080e99c313ecae9a34c60d11d&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.whump.com/&quot;&gt;Bill Humphries&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221083537&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2005-12-19T06:38:33&quot;&gt;2005-12-19T06:38:33&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;ol&gt;
&lt;li&gt;PHP has some future-proofing in that almost everyone doing web development knows it or can pick it up. That reduces risks for IT adoption.&lt;/li&gt;
&lt;li&gt;$5/month web hosts have it installed.&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221083539&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://wdogsystems.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=6e24f47aa88626872c16e0f740739e8a&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://wdogsystems.com&quot;&gt;Tim Howland&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221083539&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-01-10T14:27:54&quot;&gt;2006-01-10T14:27:54&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;While I don't care for the crappy structure that the language seems to revel in (SQL in your HTML? WTF?), what I despise about PHP is how hard it is to build and deploy it with a ny extensions to the basic feature set.&lt;/p&gt;

&lt;p&gt;If you need to do images, you compile in LibGD, if you want to render text, you get the freetype libraries, if you need something that isn't mysql, you compile that in- and then off you go trying to find the version of libJpeg from 1993, because the ancient version of libGD that's bundled with PHP doesn't work with anything more recent.&lt;/p&gt;

&lt;p&gt;Plain-vanilla PHP is ubiquitous, but trying to roll your own on an arbitrary box somewhere and do something that doesn't come with the default PHP that ships with your distribution is a huge and unnecessary pain in the ass. Perl can be annoying, but at least it isn't a monolithic binary- the library system drastically reduces the cross-component dependencies that PHP suffers from.&lt;/p&gt;

&lt;p&gt;PHP sucks, and it amazes me that it is so ubiquitous. On the otherhand, so is Microsoft Windows.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;/ul&gt;
    
        &lt;/div&gt;



</content>
    </entry>
    
    
</feed>

