|
Posted by Chung Leong on 08/15/06 21:44
Rik wrote:
> Pardon, 'reuse'? How many heads/closing html tags do you want in a page? I
> normally opt for just one, but hey, that's silly me.
Code reuse typically means using the same code in more than one place,
as opposed to it being used multiple time in a single operation.
> Well, that's indeed a pro to the include.
> However, a con is this: If I want to change something in the head once the
> project is running, I usually don't want to fiddle around in files anymore,
> I want to be able to change it in an interface. While a *.php page can just
> be opened and displayed in an textarea, I'm definitely more at ease working
> on the plain HTML bits.
I would hardly call that a con. You can easily accommodate such a
requirement by changing the function. Since it's easier to edit the
template as a whole as opposed to it being splitted (since start tags
have to be reconciled with the end tag), you can load the whole frame
into the editor then use a keyword to determine where the split should
occur.
> Then again, my bigger projects all have a dynamically built head section,
> little to no actual static HTML content there.
One shouldn't confuse implementation with purpose. The purpose is the
same whether it's a block of static HTML or some super dynamic code--to
output a page header. When you have code that's properly encapsulated,
the caller wouldn't need to know how the process is implemented.
[Back to original message]
|