Re: Frequent Mode Switching
| From: | Reuben D. Budiardja | Date: | Tue, 05 Aug 2003 21:42:51 +0000 |
| Subject: | Re: Frequent Mode Switching | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-158356@lists.php.net to get a copy of this message | ||
On Tuesday 05 August 2003 05:21 pm, Jim Lucas wrote:
> 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.
it's probably more readable and/or organized, but str_replace() is way more
expensive than just echoing variable, is it not?
RDB
> 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
--
-------------------------------------------------
/"\ ASCII Ribbon Campaign against HTML
\ / email and proprietary format
X attachments.
/ \
-------------------------------------------------
Have you been used by Microsoft today?
Choose your life. Choose freedom.
Choose LINUX.
-------------------------------------------------