Hudzilla.org - the homepage of Paul Hudson
Contents > Miscellaneous topics > Templates Wish List | Report Bug | About Me ]

16.8.3     When not to use templates

This is NOT the latest copy of this book; click here for the latest version.

Templates, whilst being very helpful, certainly are not suitable for all environments. If you find that more often than not the pages you create are very specific to a certain task - that is, they'd be hard to generalise into a template-like form - then you definitely fall into the category of programmers who would not get much benefit from switching to templates.

Sometimes it is even the case that switching to templates can create /more/ work for you as a web developer - the act of switching to templates might end up with you spending all your time adding more complexity to your templates, creating various exceptions for specific cases in your sites. We all want to avoid as much programming pain as possible, so if in doubt, try phasing templates in bit by bit.

Another very important reason to avoid using templates is that you lose direct control of the code in quite a large way, at least if you intend to use an off-the-shelf system. Recently, I read a php-dev mailing list thread where IMP for the HORDE code framework was apparently crashing the Zend engine. If I had implemented this and it was crashing on my box, I'd certainly be unhappy - partly because it was crashing, and partly because, as the code is not mine, I would not be able to fix it! Losing control of the situation is always a bad thing, so, if you definitely want to switch to a templating system, at least use one that is stable.





<< 16.8.2 How do they work?   16.8.4 Writing your own >>
Table of Contents
Want to see this stuff in print? PHP in a Nutshell takes the core topics covered here, adds in thousands of edits from the editorial team and myself, and combines them to make an unbeatable reference for PHP programmers at all levels.



My latest book has hundreds more tips on how to use PHP, Apache, and MySQL, plus Perl, Python, shell scripts, performance tuning, and more!



Top-right shadow
 
Bottom-left shadow Bottom shadow

Comments from other readers
Be the first to add a comment to this chapter!



Add comment
Please note that by posting a comment here you are committing it to the public domain. This is important so that others can make use of your code themselves, and also so that I can incorporate helpful notes directly into the main text. Comments are limited to 2000 characters in length.

If you are reporting an error in the content, please tell me directly.

Your name/email address:
Your comment:
 
Now, in order to verify that you're a real person, please answer this simple question: what is nine plus nine?
The answer is:
(please write in
numbers, eg 19)


Top-right shadow
 
Bottom-left shadow Bottom shadow