[Templates] tt annoyances

Mark Mills mark@xodiax.com
Fri, 10 Oct 2003 13:38:43 -0400


> Yeah, when I was looking at TT before starting to use it fro the
> current project, I was struck by the amount of programming language
> already being added.  What struck *me* was that I'd rather have perl
> than some new special programming language, actually.  Or PHP, if I
> have to. :-)

The problem with in-line perl or PHP is that you often wind up
wanting to seperate the display level code from the data generation
code and you are right back to wanting a template system. If you think
I'm kidding look at how many PHP projects there are that implement
templates... http://smarty.php.net/ is the biggest that I know of but
there are plenty more.

Large PHP projects always run into the same "CGI WALL" that perl CGI
projects and ColdFusion projects slam into. At some point, interleaving
the code and the view into a single file ties your hands and feet. And
falling flat on your face hurts. :)

I've taken to looking for ugly constructs in the templates (like CASE
style IFs that set styles or nested FOREACHes) and moving some of that
work back to mod_perl or the CGI that generates the data. And I've
finally broken myself of having a single script that tries to return
two entirely different web pages based on input... those sites always
wind up being entirely broken when you try and book-mark sub-pages. I
hunt and destroy complexity at the Template level, to keep process
level features from leaking into my display code.

--mark mills
Xodiax Engineering