<?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>Wed, 19 Jun 2013 23:35:59 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[IBM developerWorks: Five good programming habits in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11506</guid>
      <link>http://www.phpdeveloper.org/news/11506</link>
      <description><![CDATA[<p>
<i>Nathan Good</i> has <a href="http://www.ibm.com/developerworks/opensource/library/os-php-5goodhabits/index.html?ca=dgr-jw64os-php-5goodhabits&S_TACT=105AGY46&S_CMP=GRsitejw64">posted five tips</a> PHP developers should use in their work to develop good programming habits to the IBM developerWorks site today.
</p>
<blockquote>
Just like any language, developers can write code in PHP that ranges in quality from truly awful to very good. Learn good programming habits that can help you bridge the productivity gap. [...] Bad coding habits seem to accompany defects in code and can cause code to be difficult to change without introducing new defects. The following five good habits, when applied to your PHP code, will help you avoid these pitfalls.
</blockquote>
<p>Here's the list:</p>
<ul>
<li>Use good naming.
<li>Take smaller bites.
<li>Document your code.
<li>Handle error conditions.
<li>Never, ever, copy and paste.
</ul>]]></description>
      <pubDate>Thu, 04 Dec 2008 12:04:56 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[IBM developerWorks: Build seven good object-oriented habits in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11320</guid>
      <link>http://www.phpdeveloper.org/news/11320</link>
      <description><![CDATA[<p>
The IBM developerWorks website has <a href="http://www.ibm.com/developerworks/opensource/library/os-php-7oohabits/index.html?ca=drs-tp4408">a few suggestions</a> - seven of them, in fact - that they think can help make you a better PHP programmer.
</p>
<blockquote>
With PHP's object-oriented (OO) language features, if you aren't already creating your applications with OO principles in mind, these seven habits will help you get started in the transition between procedural programming and OO programming.
</blockquote>
<p>
Each of the seven OOP habits have more details below them, but here's the short list:
</p>
<ul>
<li>Be modest.
<li>Be a good neighbor.
<li>Avoid looking at Medusa.
<li>Embrace the weakest link.
<li>You're rubber; I'm glue.
<li>Keep it in the family.
<li>Think in patterns.
</ul>
<p>
In each there's a "bad habit" and a "good habit" to explain the concept a bit more fully, everything from error handling to interfaces.
</p>]]></description>
      <pubDate>Fri, 31 Oct 2008 07:51:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[IBM DeveloperWorks: Seven habits for writing secure PHP applications]]></title>
      <guid>http://www.phpdeveloper.org/news/11125</guid>
      <link>http://www.phpdeveloper.org/news/11125</link>
      <description><![CDATA[<p>
The IBM DeveloperWorks site has <a href="http://www.ibm.com/developerworks/opensource/library/os-php-secure-apps/index.html?ca=dgr-btw01PHP-7Habits&S_TACT=105AGX59&S_CMP=grsite-btw01">posted some advice</a> that can help keep you, your application and your data safe from security-related attacks.
</p>
<blockquote>
Security in a PHP application includes remote and local security concerns. Discover the habits PHP developers should get into to implement Web applications that have both characteristics. 
</blockquote>
<p>
The habits in <a href="http://www.ibm.com/developerworks/opensource/library/os-php-secure-apps/index.html?ca=dgr-btw01PHP-7Habits&S_TACT=105AGX59&S_CMP=grsite-btw01">their list</a> are:
</p>
<ul>
<li>Validate input
<li>Guard your file system
<li>Guard your database
<li>Guard your session
<li>Guard against XSS vulnerabilities
<li>Guard against invalid posts
<li>Protect against CSRF
</ul>
<p>
Each comes with their own explanation and for some, code to help you spot the mistakes and correct them.
</p>]]></description>
      <pubDate>Wed, 01 Oct 2008 10:28:55 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Joakim Nygard's Blog: Optimizing PHP Through Habits]]></title>
      <guid>http://www.phpdeveloper.org/news/7705</guid>
      <link>http://www.phpdeveloper.org/news/7705</link>
      <description><![CDATA[<p>
Spurred on by <a href="http://www.ilia.ws/files/zend_performance.pdf">some previous benchmarks</a> [pdf] from <i>Ilia Alshanetsky</i>, <i>Joakim Nygard</i> decided to <a href="http://jokke.dk/2007/03/optimizing_php_through_habits">run some his own benchmarks</a> on the same sort of functionality.
</p>
<blockquote>
There are numerous discussions in the blogosphere about whether to use <a href="http://www.google.com/search?q=php+echo+vs+print">echo versus print</a>, if <a href="http://www.google.com/search?q=php+for+benchmark+while">for() is faster than while()</a>, etc. and though the gains are usually very small, I decided to add my thoughts to the debate. I found an article on optimization through coding habits in <a href="http://www.ilia.ws/files/zend_performance.pdf">Ilia Alshanetsky's zend performance slides</a>.
</blockquote>
<p>
According to <a href="http://jokke.dk/2007/03/optimizing_php_through_habits">his results</a>:
<ul>
<li>Calling require_once() 10000 times in a for() loop with an empty file is 4x faster.
<li>With a simply autoload requiring a class and 10000 loops of new Foo() versus require_once('foo.php'); new Foo() shows that __autoload() is ~3.7 times faster.
<li>If a class method can be static, declare it static. Speed improvement is by a factor of 4.
<li>Avoid function calls within for() loop control blocks
<li>Always, always quote array keys.
<li>Get rid of 'harmless' error messages - they take time to generate and output. 
</ul>
</p>
<blockquote>
I am not out to prove Ilia wrong - he knows PHP better than most - and for all I know, they could have optimized those very functions in PHP 5.2. [...] It would appear that there are improvements, albeit small, to achieve from minimal effort. Plus I was surprised by the discrepancies I found compared to Ilia's recommendations.
</blockquote>]]></description>
      <pubDate>Wed, 25 Apr 2007 10:39:00 -0500</pubDate>
    </item>
  </channel>
</rss>
