<?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>Sun, 19 May 2013 04:19:03 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Nikita Popov's Blog: Don't be STUPID: GRASP SOLID!]]></title>
      <guid>http://www.phpdeveloper.org/news/17314</guid>
      <link>http://www.phpdeveloper.org/news/17314</link>
      <description><![CDATA[<p>
<i>Nikita Popov</i> talks about the <a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod">SOLID</a> coding practices and creates his own acronym for the complete opposite - <a href="http://nikic.github.com/2011/12/27/Dont-be-STUPID-GRASP-SOLID.html">STUPID</a> (Singleon, Tight coupling, Untestable, Premature optimization, Indescriptive naming, Duplication).
</p>
<blockquote>
Ever heard of SOLID code? Probably: It is a term describing a collection of design principles for "good code" that was coined by Robert C. Martin (aka "uncle bob"), our beloved evangelist of clean code. [...] So, why not approach the problem from the other side for once? Looking at what makes up bad code.
</blockquote>
<p>
He goes through each part of his STUPID acronym and talks about how it can hurt your code and a few alternatives to help make your application more flexible and easier to maintain in the long run. He also mentions <a href="http://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29">GRASP</a> (General Responsibility Assignment Software Principles), another set of good practices to follow, some similar to SOLID, that can make your app better.
</p>]]></description>
      <pubDate>Wed, 28 Dec 2011 09:26:14 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Scott MacVicar' Blog: Stupid Bug Reports]]></title>
      <guid>http://www.phpdeveloper.org/news/11855</guid>
      <link>http://www.phpdeveloper.org/news/11855</link>
      <description><![CDATA[<p>
Most of the bugs that get reported to the PHP project are pretty useful. They help developers track down those small, random issues that might slip through the cracks otherwise. There are, however, some of them that make you wonder a bit about the person that submitted them <i>Scott MacVicar</i> takes a look at a few of them in <a href="http://www.macvicar.net/blog/2009/02/stupid-bug-reports.html">a new blog post</a>.
</p>
<blockquote>
Recently the PHP project has been receiving an increasing number of rather silly reports, these vary from simply not reading the manual, searching the internet or a fundamental lack of understanding how the internet works.
</blockquote>
<p>
He points out three in particular (from the same person, no less) about things that shown an almost complete lack of understand of what PHP does. One was a request to make PHP <a href="http://bugs.php.net/bug.php?id=46856">use less CPU</a> and another asking to make PHP <a href="http://bugs.php.net/bug.php?id=46875">censorship free</a> and, finally, <a href="http://bugs.php.net/bug.php?id=47248">a request to make PHP more secure</a>...by doing away with support for cookies. 
</p>
<p>
<i>Scott</i> also suggests a few constructive things you can do before submitting a good (useful) bug report:
</p>
<ul>
<li>Gather together as much relevant information as you can (generalizations are bad)
<li>Run performance checks against older PHP versions to try to pin down when the bug was added
<li>And, finally: "don't get aggressive or be an asshole when your bug reports get closed".
</ul>]]></description>
      <pubDate>Mon, 02 Feb 2009 09:34:18 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Debuggable Blog: Programming Psychology II: Private methods ]]></title>
      <guid>http://www.phpdeveloper.org/news/10560</guid>
      <link>http://www.phpdeveloper.org/news/10560</link>
      <description><![CDATA[<p>
According to <i>Felix Geisendorfer</i>'s <a href="http://www.debuggable.com/posts/programming-psychology-ii-private-methods:481ed862-b0d8-4a0e-9247-165c4834cda3">newest post</a> on the Debuggable blog, he thinks that "private and protected methods and properties are one of the most stupid concepts of OOP."
</p>
<blockquote>
This is a thought I first shared at <a href="http://debuggable.com/posts/cakefest-orlando-2008-summary:480f4dd6-6404-4774-a771-4e8fcbdd56cb">CakeFest Orlando</a> this year, but could not explain properly at the time.
</blockquote>
<p>
He illustrates with an example of a protected "balance" variable in a BankAccount class. Sure, it's marked as private but less skilled programmers might not use it that way. He recommends a method without the getters/setters to help make the usage of the variable a bit simpler. He also suggests that using protected/private scoping helps to promote "crappy code" - using them to provide a sort of protection for code that you either don't want getting used or hiding it away so the API can't get at it.
</p>]]></description>
      <pubDate>Tue, 08 Jul 2008 08:44:58 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Moon's Blog: Stupid PHP Tricks: Normalizing SimpleXML Data]]></title>
      <guid>http://www.phpdeveloper.org/news/10328</guid>
      <link>http://www.phpdeveloper.org/news/10328</link>
      <description><![CDATA[<p>
<i>Brian Moon</i> has a "stupid PHP trick" posted to his blog today - <a href="http://brian.moonspot.net/2008/06/03/stupid-php-tricks-normalizing-simplexml-data/">normalizing SimpleXML data</a> you've pulled in from just about any external source.
</p>
<blockquote>
Anyhow, one annoying thing about SimpleXML has to do with caching.  When using web services, we often cache the contents we get back.  We were having a problem where we would get an error about a SimpleXML node not existing.
</blockquote>
<p>
They were using memcache to store the information but came across problems when their code tried to use a (sometimes) empty tag. He gives two solutions - one using a recursive function that identifies the empty items and the other that encodes then decodes the object to and from JSON, keeping the values intact.
</p>]]></description>
      <pubDate>Tue, 03 Jun 2008 09:34:22 -0500</pubDate>
    </item>
  </channel>
</rss>
