Re: PEAR CS poll
| From: | Ammar Ibrahim | Date: | Fri, 08 Oct 2004 08:16:41 +0000 |
| Subject: | Re: PEAR CS poll | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-33697@lists.php.net to get a copy of this message | ||
Well, to me,
"some text $variable some more text" is more readable :) besides try to think of SQL queries.
"UPDATE table SET col1='{$value}', col2='{$val2}' ....."
OR
'UPDATE table SET col1=\'' . $value . '\' col2=\'' .......
That;s ofcourse if you don't use variable replacement techniques that some DB wrappers provide.
db->query('UPDATE table SET col1=\'{:1}\'........, array( $value1, $val2, .....)
After all, this is a matter of personal preference, but I don't see it that way when you have a String that doesn't contain variables.
-Ammar
I'm pretty sure you have to use double quotes to do variable interpolation. My point is that variable interpolation is never necessary and in, my opinion, never good idea. I think it is typically more readable to do something like: 'some text' . $variable . 'some more text' rather than: "some text $variable some more text" or even "some text {$variable} some more text" The reason? Syntax highlighting in text editors. With my method, the variable gets lit up in a different color than the text. I'd like to see this part of the CS, but that's just my preference. -ryan