<?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>Fri, 24 May 2013 18:50:26 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPClasses.org: 8 defensive programming best practices to prevent breaking your sites]]></title>
      <guid>http://www.phpdeveloper.org/news/7715</guid>
      <link>http://www.phpdeveloper.org/news/7715</link>
      <description><![CDATA[<p>
As anyone who's been developing applications (web or otherwise) knows, there are certain things that you just don't do when you're doing things like adding features or changing the code of a production application. There are some general rules to follow and <a href="http://www.phpclasses.org/blog/post/65-8-defensive-programming-best-practices-to-prevent-breaking-your-sites.html">this new article</a> on the PHPClasses.org website reminds us of just a few.
</p>
<blockquote>
This article describes software development practices that have been used to prevent problems that can break Web sites.
</blockquote>
<p>
Included in <a href="http://www.phpclasses.org/blog/post/65-8-defensive-programming-best-practices-to-prevent-breaking-your-sites.html">his list</a> are things like:
<ul>
<li>Handle unexpected conditions
<il>Test your code
<li>Monitor your site errors and act upon them
<li>Do not disclose errors to the users
<li>Do what you can as you can never get defensive enough
</ul>
He also recommends two resources for some additional reading - the <a href="http://en.wikipedia.org/wiki/Defensive_programming">Wikipedia entry</a> for "defensive programming" and <a href="http://gettingreal.37signals.com/ch09_Get_Defensive.php">a chapter from Getting Real</a> (from 37 Signals) about how to "Get Defensive".
</p>]]></description>
      <pubDate>Thu, 26 Apr 2007 11:11:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ivo Jansch's Blog: Defensive Programming]]></title>
      <guid>http://www.phpdeveloper.org/news/4739</guid>
      <link>http://www.phpdeveloper.org/news/4739</link>
      <description><![CDATA[In <a href="http://www.achievo.org/blog/archives/27-Defensive-Programming.html">his latest blog post</a> today, <i>Ivo Jansch</i> takes a look a t a situation where a little "defensive programming" would have helped.
<p>
<quote>
<i>
A few weeks ago, we had a major problem with software we'd written for a client. It was software for sending mailings to the client's customers. Suddenly there were many reports of clients receiving multiple mailings instead of just one.
<p>
The problem appeared to be in our test code. The software had a 'test' mode for testing the mailing by sending it only to the author and a small test team. It appeared that for some reason, all test mails were being mailed to the customers as well.
<p>
This problem would not have appeared if we had applied what I would like to call 'defensive programming'.
</i>
</quote>
<p>
He <a href="http://www.achievo.org/blog/archives/27-Defensive-Programming.html">shows</a> code examples from this situation, pointing out where the issue lies - a bad check in an if() statement. ]]></description>
      <pubDate>Fri, 27 Jan 2006 07:01:48 -0600</pubDate>
    </item>
  </channel>
</rss>
