<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Tue, 21 May 2013 11:57:49 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Court Ewing's Blog: Forget Concatenation; Format your strings!]]></title>
      <guid>http://www.phpdeveloper.org/news/15138</guid>
      <link>http://www.phpdeveloper.org/news/15138</link>
      <description><![CDATA[<p>
On his blog today <i>Court Ewing</i> has <a href="http://epixa.com/2010/09/forget-concatenation-format-your-strings">posted a tutorial</a> about a different approach to merging strings while formatting them at the same time - using <a href="http://php.net/sprintf">sprintf</a> and <a href="http://php.net/printf">printf</a> for more than just a single-shot output.
</p>
<blockquote>
I do it, you do it, everyone does it! We all concatenate. If you're simply combining a few variables or constants together, concatenation is the way to go. After all, it is quick and easy, and who can complain about that? However, concatenation does have two serious drawbacks: any sort of string formatting must be done manually, and it is difficult to visualize the "goal" string when it is sufficiently complex.
</blockquote>
<p>
He talks about the benefits of string formatting over basic string concatination like how easy it makes casting variable values - multiple or single - without you having to cast them manually and append. He gives a few code examples of how it can be used for simple formatting and how it can make escaping data used in multiple spots easier. He also includes a SQL query example showing the difference between using <a href="http://php.net/sprintf">sprintf</a> and a normal concatinated statement.
</p>]]></description>
      <pubDate>Thu, 16 Sep 2010 08:38:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Three Quick Tips To Make Your PHP Understandable]]></title>
      <guid>http://www.phpdeveloper.org/news/10479</guid>
      <link>http://www.phpdeveloper.org/news/10479</link>
      <description><![CDATA[<p>
The Zend Developer Zone has posted <a href="http://devzone.zend.com/article/3592-Three-Quick-Tips-To-Make-Your-PHP-Understandable">a new article</a> today with three tips to help you make your code a little easier to understand (both by other coders and yourself down the road).
</p>
<blockquote>
Producing code that clearly conveys a developer's intent is key to any well written application. That not only applies to PHP, but every programming language. Developers who emphasize the creation of legible code tend to create applications which are easier to both maintain and expand upon.
</blockquote>
<p>
His <a href="http://devzone.zend.com/article/3592-Three-Quick-Tips-To-Make-Your-PHP-Understandable">tips</a> include suggestions about keeping conditional logic clean, using "less PHP and more HTML" and to make the best possible use that you can out of sprintf "and friends".
</p>]]></description>
      <pubDate>Wed, 25 Jun 2008 07:57:19 -0500</pubDate>
    </item>
  </channel>
</rss>
