Re: Frequent Mode Switching
| From: | Jim Lucas | Date: | Tue, 05 Aug 2003 21:21:23 +0000 |
| Subject: | Re: Frequent Mode Switching | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-158353@lists.php.net to get a copy of this message | ||
This method has been my personal choice for the past 3-4 yrs in coding,
I have not found any problems with it thus far.
But I am gradually switching all my code over to a seperate template style
design as where I have all my values in a variable format and then parse a
*.html file and str_replace() all the values accordingly.
I have found no significant performance difference between <?= **?>, echo
"";, print()
But I have found a much cleaner method by using the templateing method that
I am switching to.
To sum it up, if you are concerned about performance, I wouldn't worry too
much. But if you are worried about readability, I would stick with the <?=
** ?> method myself. It keeps everything flowing in the script.
Jim Lucas
----- Original Message -----
From: "Derrick Fogle" <derrick@foundationcomputing.com>
To: <php-general@lists.php.net>
Sent: Tuesday, August 05, 2003 2:13 PM
Subject: [PHP] Frequent Mode Switching
> Thoughts on frequent switching in and out of PHP mode:
>
> <? switch in, do some code
> ?>Switch out, static HTML
> <? switch in, do more code
> ?>Switch out, more static HTML
>
> I've found that I prefer programming this way, for the most part,
> putting most of the heavy PHP programming at the top, and then using
> static HTML interspersed mostly with quick <?= $variable ?> statements
> for what users see.
>
> I'm sure there's more than one viewpoint out there, so I'd like to hear
> a couple of them. Is this frequent mode switching good, bad, or
> indifferent? Is there a point at which the mode switching starts to
> seriously degrade performance and reliability?
>
> -Derrick
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>