Re: Which way is better?
| From: | Jim Lucas | Date: | Fri, 09 May 2003 20:46:10 +0000 |
| Subject: | Re: Which way is better? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147067@lists.php.net to get a copy of this message | ||
I will have to agree with you on this one.
I have been working with php for around the same amount of time.
At first I used print and echo to output code.
But then I found that for myself, writing code like your example became
quick and simple
I have done many speed tests of which none have proven that one way to
output HTML is significantly faster then the other.
case study...
<!-- start print(" "); seconds: 1052497037 running total:
-->
<!-- stop print(" "); seconds: 1052497038 running total:
335672974586 -->
<!-- start print(" "); seconds: 1052497038 running total:
-->
<!-- stop print(" "); seconds: 1052497038 running total:
340480923653 -->
<!-- start echo " "; seconds: 1052497038 running total:
-->
<!-- stop echo " "; seconds: 1052497038 running total:
9365003109 -->
<!-- start ?> <? seconds: 1052497038 running total:
-->
<!-- stop ?> <? seconds: 1052497038 running total:
294946908951 -->
<!-- start ?><?=" "?><? seconds: 1052497038 running total:
-->
<!-- stop ?><?=" "?><? seconds: 1052497039 running total:
312368988991 -->
I setup a for loop that loops 100,000 times
These are the results that I get from this.
the speed of the machine doesn't matter
Jim Lucas
----- Original Message -----
From: "Justin French" <justin@indent.com.au>
To: <peter@schoenster.com>; <php-general@lists.php.net>
Sent: Thursday, May 08, 2003 9:09 PM
Subject: Re: [PHP] Which way is better?
> on 09/05/03 3:07 PM, Peter Schoenster (peter@schoenster.com) wrote:
>
> > If you've been doing web app work for awhile you'll realize the one true
> > rule is everything will change and will your code be easy to change or
> > not? Will even you be able to read it later? Your boss will not want to
> > do a re-write. I always write for ease of evolution, if writing for
> > speed write closer to the machine other than the obvious, imho.
>
> I am my own boss, have being doing this for 3-4 years, and have what has
> proven to be a robust, adaptable code base. It hasn't required any major
> overhauls, and has stood up well faced with some very unexpected client
> requests, changes and modules.
>
> *I* personally find my coding style is easy to maintain, easy to read, etc
> etc, having spent hundreds of hours working with it. You may not, but
that
> shouldn't imply that yours is the best solution to a problem.
>
> Isn't that why the PHP developers gave us MANY different ways to print
> output? So that each individual can work in a way that best suits them.
>
> Justin
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>