Re: Coding Conventions

From: Date: Fri, 03 Nov 2000 23:49:08 +0000
Subject: Re: Coding Conventions
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-23661@lists.php.net to get a copy of this message
This is an interesting question. In my wild youth I used ASP (occasionally still do - sorry George W) and there was/is a very good site/list dealing with optimising code for speed (ASP Fastcode). Benchmarks were made as to the optimum method of coding, inline (example 1), discrete (example 2), or assembling dynamic/static HTML using a whole bunch of concatenation operators and outputting a single variable. It also delved into a whole host of other coding practices, some peculiar to ASP. It might be worth benchmarking PHP similarly in a few areas to come up with a definitive style guide as to best/most efficient practice. Any views? Julian ----- Original Message ----- From: "Holev`" <webmaster@builder.co.il> To: <php-general@lists.php.net> Sent: Friday, November 03, 2000 8:47 PM Subject: Re: [PHP] Coding Conventions > example 2 is faster to write and faster to execute. > > i'm pretty sure... > > ""Kevin Queen"" <kqueen@anydevice.com> wrote in message > news:NEBBKMMPGMEIJCNLKNDGIEBJCCAA.kqueen@anydevice.com... > > List, > > I have a general knowledge question, is it best to code with one set of > php > > tags or many, examples follow: > > > > Example 1: > > ==================== > > <?php > > echo('<html><head><title>hello > > world</title></head><body><p>'); > > > > if($a==$b){ > > do some stuff > > } > > echo('about to do more stuff'); > > if($c==$d){ > > do more stuff > > } > > > > echo('</body></html>'); > > ?> > > > > Example 2: > > =================== > > <html><head><title>hello world</title><head> > > <body> > > > > <?php > > if($a==$b){ > > do some stuff > > } > > ?> > > About to do more stuff > > <?php > > if($c==$d){ > > do more stuff > > } > > ?> > > </body> > > </html> > > > > > > Is there a better of preferred way of coding, is one faster than the > other? > > This is just a curiosity question, thank you for your input. > > > > TIA, > > Kevin Queen > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#23661) next »