RE: [PHP] Code optimization: single vs. double quotes?

This is a discussion on RE: [PHP] Code optimization: single vs. double quotes? within the PHP General forums, part of the PHP Programming Forums category; Justin French <mailto:justin@indent.com.au> on Monday, October 27, 2003 2:12 PM said: > a) ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-27-2003
Chris W. Parker
 
Posts: n/a
Default RE: [PHP] Code optimization: single vs. double quotes?

Justin French <mailto:justin@indent.com.au>
on Monday, October 27, 2003 2:12 PM said:

> a) echo "<td bgcolor='{$bgcolor2}'>&nbsp;</td></tr>";
> b) echo "<td bgcolor='$bgcolor2'>&nbsp;</td></tr>";
> c) echo '<td bgcolor="'.$bgcolor2.'">&nbsp;</td></tr>';
> d) echo "<td bgcolor='".$bgcolor2."'>&nbsp;</td></tr>";


Exactly what is the problem with:

echo "<td bgcolor=\"$bgcolor2\">&nbsp;</td></tr>";

I don't see the problem.



Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/
Reply With Quote
  #2 (permalink)  
Old 10-27-2003
Chris Shiflett
 
Posts: n/a
Default RE: [PHP] Code optimization: single vs. double quotes?

--- "Chris W. Parker" <cparker@swatgear.com> wrote:
> Exactly what is the problem with:
>
> echo "<td bgcolor=\"$bgcolor2\">&nbsp;</td></tr>";
>
> I don't see the problem.


I agree with you, actually. The only things I don't like are:

1. The use of the bgcolor attribute
2. The name of the variable :-)
3. The fact that your td is not tabbed in
4. The closing tr being on the same line

But, everyone has different tastes. I tend to choose whichever format makes my
HTML look perfect while requiring the least amount of syntax in PHP.

Chris

=====
My Blog
http://shiflett.org/
HTTP Developer's Handbook
http://httphandbook.org/
RAMP Training Courses
http://www.nyphp.org/ramp
Reply With Quote
  #3 (permalink)  
Old 10-27-2003
Dvdmandt
 
Posts: n/a
Default Re: [PHP] Code optimization: single vs. double quotes?

It's said that you shouldn't use tables for layout, but does people
accutually listen to that? And what instead?

--
// DvDmanDT
MSN: dvdmandt€hotmail.com
Mail: dvdmandt€telia.com
##########################
Please, if you are using windows, you may be infected by Swen. Please go
here to find out more:
http://us.mcafee.com/virusInfo/defau...er&hcName=swen
http://securityresponse.symantec.com...swen.a@mm.html
##########################
"Curt Zirzow" <php-general@zirzow.dyndns.org> skrev i meddelandet
news:20031027231614.GM51024@bagend.shire...
> * Thus wrote Chris Shiflett (shiflett@php.net):
> > --- "Chris W. Parker" <cparker@swatgear.com> wrote:
> > > Exactly what is the problem with:
> > >
> > > echo "<td bgcolor=\"$bgcolor2\">&nbsp;</td></tr>";
> > >
> > > I don't see the problem.

> >
> > I agree with you, actually. The only things I don't like are:
> >
> > 1. The use of the bgcolor attribute
> > 2. The name of the variable :-)
> > 3. The fact that your td is not tabbed in
> > 4. The closing tr being on the same line
> >
> > But, everyone has different tastes. I tend to choose whichever format

makes my
> > HTML look perfect while requiring the least amount of syntax in PHP.

>
> 5. no newline after the tr. :)
>
> There are some broswer issues with tr and td's not being on the
> same line. But I guess that shouldn't matter much cause tables
> shouldn't be used for layout design.
>
>
> Curt
> --
> "My PHP key is worn out"
>
> PHP List stats since 1997:
> http://zirzow.dyndns.org/html/mlists/

Reply With Quote
  #4 (permalink)  
Old 10-27-2003
Curt Zirzow
 
Posts: n/a
Default Re: [PHP] Code optimization: single vs. double quotes?

* Thus wrote Chris Shiflett (shiflett@php.net):
> --- "Chris W. Parker" <cparker@swatgear.com> wrote:
> > Exactly what is the problem with:
> >
> > echo "<td bgcolor=\"$bgcolor2\">&nbsp;</td></tr>";
> >
> > I don't see the problem.

>
> I agree with you, actually. The only things I don't like are:
>
> 1. The use of the bgcolor attribute
> 2. The name of the variable :-)
> 3. The fact that your td is not tabbed in
> 4. The closing tr being on the same line
>
> But, everyone has different tastes. I tend to choose whichever format makes my
> HTML look perfect while requiring the least amount of syntax in PHP.


5. no newline after the tr. :)

There are some broswer issues with tr and td's not being on the
same line. But I guess that shouldn't matter much cause tables
shouldn't be used for layout design.


Curt
--
"My PHP key is worn out"

PHP List stats since 1997:
http://zirzow.dyndns.org/html/mlists/
Reply With Quote
  #5 (permalink)  
Old 10-27-2003
Mike Migurski
 
Posts: n/a
Default Re: [PHP] Code optimization: single vs. double quotes?

>It's said that you shouldn't use tables for layout, but does people
>accutually listen to that? And what instead?


This is veering off-topic, but:
<http://css-discuss.incutio.com/?page=CssLayouts>

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html
Reply With Quote
  #6 (permalink)  
Old 10-27-2003
Chris Shiflett
 
Posts: n/a
Default Re: [PHP] Code optimization: single vs. double quotes?

--- DvDmanDT <dvdmandt@telia.com> wrote:
> It's said that you shouldn't use tables for layout, but does people
> accutually listen to that? And what instead?


You can use stylesheets.

These work well with PHP. Well, that's my attempt at getting this thread back
on topic. :-)

Chris

=====
My Blog
http://shiflett.org/
HTTP Developer's Handbook
http://httphandbook.org/
RAMP Training Courses
http://www.nyphp.org/ramp
Reply With Quote
  #7 (permalink)  
Old 10-28-2003
Justin French
 
Posts: n/a
Default Re: [PHP] Code optimization: single vs. double quotes?

On Tuesday, October 28, 2003, at 09:23 AM, Chris W. Parker wrote:

> Exactly what is the problem with:
>
> echo "<td bgcolor=\"$bgcolor2\">&nbsp;</td></tr>";


it's purely personal -- i don't enjoy writing, re-writing, debugging or
modifying code with 100's of escaped double quotes everywhere when they
really aren't needed.

Justin

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:18 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0