NYCPHP Meetup

NYPHP.org

[nycphp-talk] single quote vs. double quote

Anirudh Zala arzala at gmail.com
Wed Apr 11 09:01:26 EDT 2007


On Wednesday 11 April 2007 16:07, David Krings wrote:
> Anirudh Zala wrote:
> > To me 2nd effect of "bad practicing" is
> > more important as far as coding is concerned.
> >
> > Even if there is little time-difference, this also tells that one is
> > using inappropriate ways while coding. So this issue has impact from both
> > sides. To me it is against good practice. To some extent it is quite fine
> > but when people "double quote" paragraph of 100 lines containing static
> > data, it would be called as bad practice.
>
> I agree, I thought for some time on how to optimize my code and I am
> pretty sure there are things that give me a bigger bang for the buck
> than changing double quotes to single quotes.
> I further think that there is a balance between code performance and
> readability. I've seen code where the programmer drops out of PHP for
> even a single word instead of concatenating that into the echoed string.
>   That is plain silly and I doubt that this turns into a performance
> improvement at all compared to doing that for the before mentioned 100
> lines of static text. But even for that there is maybe an explanation.
> The first thing for PHP that I learned was this:
> print("Hello World!");
> It took me about a year to make the move to the much easier echo and
> much later I learned that I can drop out of PHP into plain HTML and then
> go back. Bad practices are typically coming from bad teaching, and
> especially the PHP manual on php.net makes excessive use of double
> quotes. No wonder only a few really understand what the difference is,
> what to use when and why.

It is because, probably, those who knows such differences do not do 
documentation or if they don't have time to do documentation then they are 
not reviewing what has been done by documentation team and how it is written.

>
> David
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php

-- 

Anirudh Zala



More information about the talk mailing list