<?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>Thu, 04 Dec 2008 10:35:32 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Patrick Allaert's Blog: Readable PHP code #1 - Return ASAP]]></title>
      <guid>http://www.phpdeveloper.org/news/11207</guid>
      <link>http://www.phpdeveloper.org/news/11207</link>
      <description><![CDATA[<p>
<i>Patrick Allaert</i> has made <a href="http://patrickallaert.blogspot.com/2008/10/readable-php-code-1-return-asap.html">this recent post</a> to his blog looking at something that a large group of PHP developers seem to forget about - readable PHP code. Specifically, he mentions the "return as soon as possible" mentality.
</p>
<blockquote>
This is the first article of a series I will dedicate to tips to write PHP code that is easier to maintain, review, refactor,... These tips may be applied for other languages but are mainly focused on PHP. The first one could be entitled as "return as soon as possible.
</blockquote>
<p>
He compares a code example - simplifying multiple if/elses, replacing the need for multiple nested evaluations that make the code harder to read. Check out the <a href="http://1.bp.blogspot.com/_BZvUGkpgaiM/SPOF3_AMj6I/AAAAAAAAAFA/DnQqgY_cqlA/s1600-h/diff_2.png">before</a> and <a href="http://2.bp.blogspot.com/_BZvUGkpgaiM/SPOF0mCy3II/AAAAAAAAAE4/9HpsPgnA4NE/s1600-h/diff_1.png">after</a> to see how it helps the flow.
</p>]]></description>
      <pubDate>Tue, 14 Oct 2008 11:14:42 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Symfony Blog: Call the expert: A refactoring story (in Five Parts)]]></title>
      <guid>http://www.phpdeveloper.org/news/11059</guid>
      <link>http://www.phpdeveloper.org/news/11059</link>
      <description><![CDATA[<p>
In a five part series on the symfony blog, <i>Fabien Potencier</i> relates a call to the expert, a refactoring story where he helped out a fellow symfony developer with their first application.
</p>
<blockquote>
Some time ago, Vince, a seasoned PHP developer, asked me to have a look at his very first symfony project, a product store. As the mistakes he did were quite common, I decided to tell you the story of this refactoring session in the hope you will learn as much as Vince did
</blockquote>
<p>
Here's links to each of the five parts:
</p>
<ul>
<li><a href="http://feeds.feedburner.com/~r/symfony/blog/~3/395996234/call-the-expert-a-refactoring-story-part-1-5">Part 1</a>
<li><a href="http://feeds.feedburner.com/~r/symfony/blog/~3/396914161/call-the-expert-a-refactoring-story-part-2-5">Part 2</a>
<li><A href="http://feeds.feedburner.com/~r/symfony/blog/~3/397863121/call-the-expert-a-refactoring-story-part-3-5">Part 3</a>
<li><A href="http://feeds.feedburner.com/~r/symfony/blog/~3/398701864/call-the-expert-a-refactoring-story-part-4-5">Part 4</a>
<li><a href="http://feeds.feedburner.com/~r/symfony/blog/~3/399485018/call-the-expert-a-refactoring-story-part-5-5">Part 5</a>
</ul>]]></description>
      <pubDate>Mon, 22 Sep 2008 15:34:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPImact Blog: Refactoring the Front Controller of the Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/10869</guid>
      <link>http://www.phpdeveloper.org/news/10869</link>
      <description><![CDATA[<p>
The PHP::Impact blog has a <a href="http://phpimpact.wordpress.com/2008/08/20/refactoring-the-front-controller-of-the-zend-framework/">new tutorial</a> posted today with a look at a refactoring of the front controller of the Zend Framework to make it a bit more manageable.
</p>
<blockquote>
One of the most fundamental decision in object design is deciding where to put responsibilities. No one, and I mean no one, gets it right the first time. That's why refactoring is so important. As Kent Beck puts it, refactoring is the process of taking a system and adding to its value, not by changing its behaviour but by giving it more of these qualities that enable us to continue developing at speed.
</blockquote>
<p>
He follows the "extract" refactoring method that makes things simpler by removing unneeded parts of the code (in favor of an interchangeable external "extract class". He removes seven methods from the class and splits them off into their own. This reduces the controller down to a more manageable size and takes a lot of the complexity out. 
</p>]]></description>
      <pubDate>Wed, 20 Aug 2008 14:04:01 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Harry Roberts' Blog: Flexible PHP Interfaces]]></title>
      <guid>http://www.phpdeveloper.org/news/10392</guid>
      <link>http://www.phpdeveloper.org/news/10392</link>
      <description><![CDATA[<p>
In an effort to breathe as much life into an old bit of software he was having to update, <i>Harry Roberts</i> worked up a <a href="http://codeb.us/flexible-php-interfaces">list of things</a> that he sees can make things a bit more "programmer friendly" when it comes to using classes, methods and interfaces in your code.
</p>
<p>His list of four is:</p>
<ul>
<li>Doc Comments
<li>Flexible Parameters
<li>Use method Entry contracts
<li>Be Stateful and Refactor
</ul>
<p>
The "Doc Comments" is pretty obvious, but some of the others need a bit more explaining. Being flexible with your parameters is more about requiring the least from a developer, "entry contracts" being the restrictions to let the developer know what you're expecting and refactoring commonly used functionality into a easy, single point of contact.
</p>]]></description>
      <pubDate>Wed, 11 Jun 2008 13:40:10 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Refactoring PHP Code]]></title>
      <guid>http://www.phpdeveloper.org/news/8668</guid>
      <link>http://www.phpdeveloper.org/news/8668</link>
      <description><![CDATA[<p>
<i>Roy Ganor</i> has <a href="http://devzone.zend.com/article/2514-Refactoring-PHP-Code">posted a new article</a> on the Zend Developer Zone about code refactoring, what it's good for and how it can help you and your code.
</p>
<blockquote>
At first, refactoring seemed to me to be magic, over the years I have come to view it as more of a trick, and today refactoring is integrated into my development environment and used frequently and quickly. Using the refactoring functionality, in addition to other tools, I can sculpt the code to improve legibility and maintainability.
</blockquote>
<p>
He talks about why PHP developers should jump on getting to refactoring their code, the different forms of refactoring, code examples showing it at work and some development tools/resources you can use to dig a little deeper.
</p>]]></description>
      <pubDate>Mon, 17 Sep 2007 18:17:17 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weir O'Phinney's Blog: File_Fortune refactored]]></title>
      <guid>http://www.phpdeveloper.org/news/8192</guid>
      <link>http://www.phpdeveloper.org/news/8192</link>
      <description><![CDATA[<p>
In a <a href="http://weierophinney.net/matthew/archives/142-File_Fortune-refactored.html">new blog entry</a> today, <i>Matthew Weir O'Phinney</i> talks about updates (and refactoring) that he's done to a PEAR package he's developed, <a href="http://pear.php.net/package/File_Fortune">File_Fortune</a>.
</p>
<blockquote>
Over the past few evenings, I've refactored <a href="http://pear.php.net/trackback/trackback.php?id=File_Fortune">File_Fortune</a> to have it implement Iterator, Countable, and ArrayAccess -- basically allowing it to act like an array for most intents and purposes. As a result, I've eliminated the need for the File_Fortune_Writer package, and greatly simplified the usage.
</blockquote>
<p>
The package is designed to make an interface between the casual PHP user and the fortune files common on most *nix machines. To illustrate he update, he <a href="http://weierophinney.net/matthew/archives/142-File_Fortune-refactored.html">includes some code</a> that grabs the fortune file, parses it to grab a random one and echoes them out. Also included is the save() method so you can add your own to the list easily.
</p>]]></description>
      <pubDate>Fri, 06 Jul 2007 09:36:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Padraic Brady's Blog: More OpenID (in PEAR and Refactoring)]]></title>
      <guid>http://www.phpdeveloper.org/news/8127</guid>
      <link>http://www.phpdeveloper.org/news/8127</link>
      <description><![CDATA[<p>
Continuing on with his <a href="http://www.phpdeveloper.org/news/8071">look at his OpenID library</a> and its implementation, <i>Padraic Brady</i> has <a href="http://blog.astrumfutura.com/archives/293-OpenID-2.0-Library-to-PEAR,-Zend-or-both.html">two new posts</a> with more of the story.
</p>
<p>
From <a href="http://blog.astrumfutura.com/archives/293-OpenID-2.0-Library-to-PEAR,-Zend-or-both.html">the first post</a>:
</p>
<blockquote>
As a follow on from my previous entry about OpenID in the Zend Framework, I've been in brief contact with Dmitry Stogov across a scattering of emails. Dmitry posted his OpenID proposal for the framework over at the Proposals Wiki earlier in the week. [...] It's actually very hard to comment constructively rather than simply handing over my code which probably says a lot more all by itself. [...] Anyway, I've agreed to port my OpenID library to PEAR as a PHP5 package. I checked with the mailing list, and the approach I've taken in splitting the library across a number of freestanding components hasn't seen any objections. On the flipside, it does help by providing upgrades to existing PEAR Encryption packages which are not yet migrated to PHP5 versions.
</blockquote>
<p>
And from <a href="http://blog.astrumfutura.com/archives/294-Refactoring-an-OpenID-Library.html">post number two</a>:
</p>
<blockquote>
Over the weekend, I managed to grab a few hours to dig around my OpenID library with the ultimate development tools: patience and experimentation. [...] What I've refactored towards is a splitting of the OpenID process based on three categories: Request, Redirect, Response.
</blockquote>]]></description>
      <pubDate>Tue, 26 Jun 2007 11:49:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weir O'Phinney' Blog: Zend_XmlRpc_Server]]></title>
      <guid>http://www.phpdeveloper.org/news/6508</guid>
      <link>http://www.phpdeveloper.org/news/6508</link>
      <description><![CDATA[<p>
<i>Matthew Weir O'Phinney</i> has been hard a towkr these past few months on his own contribution to the <a href="http://framework.zend.com">Zend Framework</a>, the Zend_XmlRpc_Server package. He <a href="http://weierophinney.net/matthew/archives/126-Zend_XmlRpc_Server.html">talks about it</a> on his latest blog posting today.
</p>
<blockquote>
In the past couple weeks, I've refactored it to push the class/function reflection into Zend_Server_Reflection, and, in doing so, noted that there were further areas for refactoring into additional helper classes. Currently, it now has classes for the Request, Response, and Faults, and all actual XML wrangling is done in those, making the server basically XML-agnostic.
</blockquote>
<p>
The refactoring of the code also had another positive side effect - it made it much simpler for him to write up the tests to ensure the correct functionality of the package. He <a href="http://weierophinney.net/matthew/archives/126-Zend_XmlRpc_Server.html">includes an example</a> of the use of the package, a fake request with various methods in the comb, brush, and pick categories. 
</p>
<p>
If you'd like to mess with the extension yourself, check out the Zend Framework <a href="http://framework.zend.com/wiki/display/ZFDEV/Zend+Framework+Subversion+Standards">subversion repository</a> and grab the latest incubation distribution.
</p>]]></description>
      <pubDate>Mon, 16 Oct 2006 13:49:53 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Felix Geisendorfer's Blog: Test Driven Development in Real World Apps]]></title>
      <guid>http://www.phpdeveloper.org/news/6260</guid>
      <link>http://www.phpdeveloper.org/news/6260</link>
      <description><![CDATA[<p>
<i>Felix Geisendorfer</i> shares, in <a href="http://www.thinkingphp.org/2006/09/10/test-driven-development-in-real-world-apps/">this new post</a> to the ThinkingPHP blog, some of his experiences with writing his code using test driven development.
</p>
<blockquote>
So far I've had tons of fun trying to create php code using test driven development. It caused my code to become a lot more structured/consistent because writing the tests shows you interfaces problems right away. This is because the process of writing the test forces you to think a lot more about *how* you want to use some class / piece of code vs. your traditional "how can I get task x done"-thinking.
</blockquote>
<p>
He <a href="http://www.thinkingphp.org/2006/09/10/test-driven-development-in-real-world-apps/">also points out</a> another benefit - it makes refactoring the code even easier (so there's more of a likelyhood that you'll use it again and again). He talks specifics about a library that he's been working on and the processes he's gone through to make things work with the testing versus his normal development cycle.
</p>]]></description>
      <pubDate>Wed, 13 Sep 2006 07:31:48 -0500</pubDate>
    </item>
  </channel>
</rss>
