Server Pages are evil
Building the World Wide Maintenance Nightmare
The majority of todays web applications are build using server page
tools like PHP, ASP or ePerl. As a result they are separating interface
and implementation with tags like <?, <server> or even quotes (
especially the escaping of quotes does create extremely boring
maintenance puzzles).
The solution to this is to use a template engine (such as
Interpolate). If this is not an option,
substitute technology by discipline. If you are using server pages to
embed function calls and standardize a way to do loops and conditions on the
pages you have in fact a template engine.
Why do you want to use templates?
- The first thing that you probbably want to change in a web application is
the page layout.
- There are no good programmers that are good designers.
- Pages should be editable using tools like Dreamweaver without
endangering the source code.
- Similiar data (e.g. article groups in a catalog) can be
displayed using the same source code to fill different templates.
Another drawback of server pages is that they discourage modularity. Once
you are inside a function you can not use these nifty server tags any more.
So programmers doing server pages tend to avoid function calls and end up
with pages of several 1000 lines. Modularizing parts of the page layout by
using subtemplates is out of reach, because
most server page engines do not allow you to call their parsing function.
Exceptions are ePerl, where you can call the parsing function and Embperl,
which has a mechanism called sub to modularize pages.