Re: Tidy HTML source?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 12/1/2006 02:22 PM, Richard Lynch wrote:
On Thu, November 30, 2006 6:47 pm, Paul Novitski wrote:
> A templating system requires the processor to merge content with
> template.  An inline markup assembly system requires the processor to
> build the markup from function calls.  Where is the technique that
> doesn't take machine cycles?

You did NOT just compare a function call with an fstat and disk seek
and disk read as if they were equal?!!!

Show me *ANY* machine on the planet where those two options have
similar performance metrics.

Actually I was referring to machine cycles, not disk access time. But on the topic of disc access, most mid-to-large PHP applications are going to be opening & reading various files -- PHP includes, databases, and not uncommonly images and text files. Even if a templating application had a somewhat higher different disk-access profile from the average PHP app, I wouldn't consider that by itself to be a reason not to open template files. I consider that to be good use of the resources, not abuse.


>>You have to parse them.
>
> Not necessarily.  But if you do need to parse them, you need to write
> the parsing engine only once.

You mean all those templating languages are still on version 1.0 of
their parser?

I think not.

I think not, either. The person I was replying to said, "You have to parse them," as though parsing a lot of files meant a lot of human labor. My reply meant that once you write the parser, your work is done, and then the parser parses any and all files you give it for lunch. Of course you're going to improve a parser over time, just as you are going to improve all aspects of a maturing application.


>>Also you have to track and manage them.
>
> Yes, as you must manage all the files that make up a project.  Adding
> a few more isn't a burden, especially if they bring clarity and
> efficiency to the work.

Few?

Try 10 X as many for most templating solutions.

Ten times as many templates as there are pages on the site? Wow, that's a lot. Fortunately I don't use any of those templating solutions you're referring to, and excessive templates isn't a problem for me. My own software usually takes three templates per page -- header, body, and footer, and the header and footer are generally global throughout the site. That seems quite reasonable to me.

Warm regards,
Paul
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux