At 10:23 AM +0800 10/3/06, Glenn Richmond wrote:
I'll probably
get strong opposition for these comments, but in my opinion, there's
nothing worse than mixing two different lanuages in a single file, not
to mention mixing functional code with layout code.
Glenn.
Glenn:
I agree with the concepts of unobtrusive code and the separation of
content, presentation, and behavior. However, I find it very
difficult not to mix languages -- for example, trying to generate
dynamic html from php/mysql without mixing all three languages is
difficult, if not impossible.
Plus, when php can generate html, css, javascript, and content --
it's not possible (by definition) to create language-pure code under
those conditions.
Also, sometimes mixing languages is preferable (with regard to
readability) than trying to develop a scheme to separate them.
And lastly, what constitutes separation? Is an include(), or date(),
or any php function from within a html, or css, file acceptable? If
not, what's the cost in readability or lines of additional code to
obtain the same functionality?
I don't know about others, but the language line is blurred for me. I
still believe in the "concepts" separation of content, presentation,
and behavior, but php transcends the other languages in a different
manner and provides the "glue" to hold them together and make them a
cohesive functional solution. In my mind, the "concept of separation"
does not fall clearly along language boundaries.
While this is not meant to demean php, I see php not only as a
"stand-alone" language, but as an addition to html, css, and
javascript, which can enhance their functionality. Clearly each of
those languages can do more with php than without it.
That's my perspective.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php