<?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>Sat, 25 May 2013 04:23:48 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[NetTuts.com: 20 All Too Common Coding Pitfalls For Beginners]]></title>
      <guid>http://www.phpdeveloper.org/news/18733</guid>
      <link>http://www.phpdeveloper.org/news/18733</link>
      <description><![CDATA[<p>
On NetTuts.com there's a great list of tips and things to keep in mind if you're a budding programmer - a set of <a href="http://net.tutsplus.com/tutorials/tools-and-tips/20-all-too-common-coding-pitfalls-for-beginners/">common pitfalls to watch out for</a> as you hone your skills.
</p>
<blockquote>
Regardless of our current skill level, we all were beginners at one point in time. Making classic beginner mistakes comes with the territory. Today, we've asked a variety of Nettuts+ staff authors to chime in with their list of pitfalls and solutions - in a variety of languages. Learn from our mistakes; don't do these things!
</blockquote>
<p>
The article starts off with some Javascript tips, but quickly gets into some more PHP specific things like:
</p>
<ul>
<li>Use Ternary When Appropriate
<li>Use Guard Clauses
<li>Keep Methods Maintainable
<li>Avoid Deep Nesting
<li>Don't Overuse Variables
</ul>
<p>
There's also two "extras" thrown in more concerning general programming practices - using methods to represent actions and some basic code readability suggestions.
</p>]]></description>
      <pubDate>Mon, 12 Nov 2012 14:52:59 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ulf Wendel: Not only SQL injection: I don't trust you!]]></title>
      <guid>http://www.phpdeveloper.org/news/18520</guid>
      <link>http://www.phpdeveloper.org/news/18520</link>
      <description><![CDATA[<p>
On his site today <i>Ulf Wendel</i> <a href="http://blog.ulf-wendel.de/2012/not-only-sql-injection-i-dont-trust-you/">talks about SQL injection</a> and some comments that came up during <a href="http://www.mysql.com/news-and-events/web-seminars/display-725.html">a recent webinar</a> about common MySQL mistakes PHP developers make.
</p>
<blockquote>
Never trust user input! Injection is a threat . You are the new web developer, aren't you?. Never trust user input is the first rule I had to learn as a web developer in anchient times. Injection can happen whenever user input is interpreted or used to compose new data. A quick recap of the #3 mistake from todays <a href="http://www.mysql.com/news-and-events/web-seminars/display-725.html">Top 10 MySQL Tips and Mistakes for PHP Developers</a> web presentation. A webinar recording should be available in a couple of days.
</blockquote>
<p>
He points out a few "don't" things to avoid - like directly injecting superglobal values into your query and to remember that not all SQL injections are because of escaping issues. The real key? Validating input - be sure you're putting values into your query that are of the correct type and contain what you expect.
</p>]]></description>
      <pubDate>Wed, 26 Sep 2012 08:34:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Community News: PHPBestPractices.org - A Short Practical Guide]]></title>
      <guid>http://www.phpdeveloper.org/news/18396</guid>
      <link>http://www.phpdeveloper.org/news/18396</link>
      <description><![CDATA[<p>
There's another site tossing their hat into the "best practices in PHP" ring (the other being <a href="http://phptherightway.com">PHP The Right Way</a>) with what they call a "short, practical list for common and confusing tasks" in PHP - <a href="http://phpbestpractices.org/">PHPBestPractices.org</a>.
</p>
<blockquote>
[Outdated tutorials and information is] one of the reasons why new PHP programmers are so frequently blamed for ugly, outdated, or insecure code. They can't help it if the first Google result was a four year old article teaching a five year old method! This document tries to address that. It's an attempt to compile a set of basic instructions for what can be considered best practices for common and confusing issues and tasks in PHP. If a low-level task has multiple and confusing approaches in PHP, it belongs here.
</blockquote>
<p>The site has sections for topics like:</p>
<ul>
<li><a href="http://phpbestpractices.org/#mysql">PHP & MySQL</a>
<li><a href="http://phpbestpractices.org/#quotes">Single vs Double Quotes</a>
<li><a href="http://phpbestpractices.org/#regex">PHP regular expressions</a>
<li><a href="http://phpbestpractices.org/#validating-emails">Validating emails</a>
<li><a href="http://phpbestpractices.org/#checking-for-null">Checking null and false values</a>
</ul>
<p>
If you're interested in helping out and adding more content to the site, <a href="http://phpbestpractices.org/#maintainers">contain the maintainer</a> and let him know.
</p>]]></description>
      <pubDate>Thu, 23 Aug 2012 10:07:01 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Layer Supertype Pattern: Encapsulating Common Implementation in Multi-Tiered Systems]]></title>
      <guid>http://www.phpdeveloper.org/news/18176</guid>
      <link>http://www.phpdeveloper.org/news/18176</link>
      <description><![CDATA[<p>
On PHPMaster.com there's a new post looking at a design pattern that's commonly in use by developers but they might not know its name - the <a href="http://phpmaster.com/the-layer-supertype-pattern-encapsulating-common-implementation-in-multi-tiered-systems/">Layer Supertype</a> pattern and its use in multi-tiered systems.
</p>
<blockquote>
Inheritance offers a straightforward way to easily spawn a large number of objects that are semantically related to each other without having duplicate code. The concept is ridiculously simple - yet powerful: you first drop as much logic as possible within the boundaries of a base type (usually an abstract class, but it could be a concrete one), and then start deriving refined subtypes according to more specific requirements. [...] Not surprisingly, this repetitive encapsulation/derivation cycle lays down on the formalities of a design pattern known as <a href="http://martinfowler.com/eaaCatalog/layerSupertype.html">Layer Supertype</a>.
</blockquote>
<p>
They describe the "supertype" as a replacement for an overly bloated domain-related model. Their example replaces a PostInterface/CommentInterface with a more generic "AbstractEntity" that handles some of the basics for you - getting/setting, checking a field, setting an ID and outputing the information to an array.
</p>]]></description>
      <pubDate>Wed, 04 Jul 2012 17:13:39 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Court Ewing's Blog: Common, Cryptic PHP Errors]]></title>
      <guid>http://www.phpdeveloper.org/news/17892</guid>
      <link>http://www.phpdeveloper.org/news/17892</link>
      <description><![CDATA[<p>
<i>Court Ewing</i> has a new post to his blog describing some of the most <a href="http://epixa.com/2012/04/common-cryptic-php-errors.html">common cryptic errors</a> that you might come across in your day-to-day development.
</p>
<blockquote>
If you've been programming for awhile, then you've probably experienced your fair share of cryptic error messages. It's understandable that building in detailed error messages that are clear to even novice developers is not always a high priority for programming languages when there are so many other features to create and issues to address. The PHP language has decent error messages, but it is by no means an exception to this rule.
</blockquote>
<p>
The three errors he covers are probably familiar to anyone that's been working with PHP for any length of time:
</p>
<ul>
<li>Fatal error: Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM
<li>Fatal error: Can't use function return value in write context
<li>Fatal error: Exception thrown without a stack frame in Unknown on line 0
</ul>]]></description>
      <pubDate>Tue, 01 May 2012 13:09:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ServerGrove Blog: Common problems designers have when working with Symfony]]></title>
      <guid>http://www.phpdeveloper.org/news/17891</guid>
      <link>http://www.phpdeveloper.org/news/17891</link>
      <description><![CDATA[<p>
On the ServerGrove blog there's a new post that helps to bridge a gap between Symfony PHP developers and the designers that might be working with the result of their hard work. The post <a href="http://blog.servergrove.com/2012/04/30/common-problems-designers-have-when-working-with-symfony/">shares solutions to four common problems</a> the designer might have.
</p>
<blockquote>
For designers, Symfony2 has been a welcome change from those old flat PHP files. Twig is beautiful, the framework separates the code from the layout, and we no longer have to find our way through lines of PHP code. But if you are a designer working on a symfony project for the first time, these are a few tips that can help you get up and running quickly.
</blockquote>
<p>The four common problems they've seen are:</p>
<ul>
<li>How do I disable the toolbar at the bottom of the page?
<li>Errors about missing libraries/files
<li>No Javascript or no-css showing up
<li>A completely blank page
</ul>]]></description>
      <pubDate>Tue, 01 May 2012 12:17:28 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Padraic Brady's Blog: Interfacing The PHP World Would Be Good]]></title>
      <guid>http://www.phpdeveloper.org/news/17051</guid>
      <link>http://www.phpdeveloper.org/news/17051</link>
      <description><![CDATA[<p>
<i>Padraic Brady</i> has <a href="http://blog.astrumfutura.com/2011/10/interfacing-the-php-world-would-be-good/">posted his own response</a> to some of the recent talk about <a href="http://phpdeveloper.org/news/17034">making</a> <a href="http://phpdeveloper.org/news/17042">standard</a> <a href="http://pooteeweet.org/blog/2008">interfaces</a> in PHP applications. His perspective focuses on interfaces and coupling as related to the Zend Framework.
</p>
<blockquote>
Every PHP framework has it's own unique set of interfaces for common operations such as logging, caching, http clients, filtering, validation, etc. This creates a situation where a framework tends to be loosely coupled but only within the scope of its own interfaces. [...] Loose coupling is therefore a bad joke. It is a narrowly defined concept usually described within the scope of one particular application. We never really apply the concept across multiple applications written with different frameworks because, at that point, the disparate interfaces of both frameworks would immediately make loose coupling unobtainable.
</blockquote>
<p>
He goes on to talk about a simple example, ZendFeedReader, and how it's very difficult to swap something as simple as the HTTP client out for one from another framework. He mentions the common scapegoat for over-interfacing - Java - and how PHP's is a bit more "practical and flexible" in that department (a good and bad thing).
</p>
<blockquote>
So yes, common interfaces would benefit PHP and would make framework libraries more interoperable and thus usable within competing frameworks. Hey, if you can't beat them at least make sure you can inject your classes into them. Hmm, still sounds dirty.
</blockquote>]]></description>
      <pubDate>Thu, 27 Oct 2011 11:36:30 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: Debate - How to Interface the PHP World]]></title>
      <guid>http://www.phpdeveloper.org/news/17042</guid>
      <link>http://www.phpdeveloper.org/news/17042</link>
      <description><![CDATA[<p>
In a new post to DZone.com today <i>Mitchell Pronschinske</i> <a href="http://php.dzone.com/news/debate-how-interface-php-world">responds to some comments</a> that were <a href="http://pooteeweet.org/blog/0/2008#m2008">made by Lukas Smith</a> about working with interfaces in PHP and what he sees as an ideal "drop in" solution.
</p>
<blockquote>
The PHP community was reacting to Lukas Smith's "Interfacing the PHP world" for most of last weekend. [...] It's a pretty major propositon to start 'interfacing the PHP' world.  Catch up on the conversation and let us know what you think.
</blockquote>
<p>
<i>Mitchell</i> summarizes <i>Lukas'</i> thoughts into three points - interfaces in separate repositories, PHP frameworks not adopting 5.3 yet and the customization of method names/naming conventions across frameworks and tools. Another response to <i>Lukas</i> came from <a href="http://www.hermanradtke.com/blog/please-do-not-interface-the-php-world/">Herman Radtke</a> with <i>Lukas</i> following up his original post with <a href="http://pooteeweet.org/blog/2014">"Why Bother?"</a>
</p>]]></description>
      <pubDate>Wed, 26 Oct 2011 08:33:53 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lukas Smith's Blog: Why bother?]]></title>
      <guid>http://www.phpdeveloper.org/news/17034</guid>
      <link>http://www.phpdeveloper.org/news/17034</link>
      <description><![CDATA[<p>
<i>Lukas Smith</i> has put together a recent post to his blog with <a href="http://pooteeweet.org/blog/0/2014#m2014">some thoughts on standardization</a> of interfaces in PHP applications to help improve code quality and interoperability.
</p>
<blockquote>
In my previous blog post I was brainstorming the possibility of collaboration between various frameworks to define a set of common interfaces. But I kind of failed to explain why this would be useful. Herman's "rebuttal" made this omission on my part quite clear. [...] That being said the open questions left in my previous blog might still prevent this idea to take off, even if I manage to convince the general community that the above mentioned negative effects are not such a significant concern.
</blockquote>
<p>
He talks first about some of the things he sees PHP as having done right (citing its popularity) and contrasts it to Java based on the standards they impose. He goes on to mention how interfaces, introduced early enough in the process, can help with the "best tool for the job" idea (with an example involving Symfony2, Zend Framework and Doctrine).
</p>]]></description>
      <pubDate>Tue, 25 Oct 2011 08:33:44 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DeveloperDrive.com: Common Mistakes to Avoid When Coding in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17012</guid>
      <link>http://www.phpdeveloper.org/news/17012</link>
      <description><![CDATA[<p>
On the DeveloperDrive.com site today, there's a new post with a few reminders for PHP developers out there of things it's easy to forget when writing your applications - some <a href="http://www.developerdrive.com/2011/10/common-mistakes-to-avoid-when-coding-in-php/">common mistakes to avoid</a>.
</p>
<blockquote>
Despite the high expectations placed on them at times, developers are human. They were the last time we checked anyways. As humans, we are bound to make mistakes from time to time. And simple, common mistakes often slip past our filters the more comfortable we become with something. [...] But knowing what these common mistakes are and how to avoid them can really help speed up the development process and keep our clients smiling.
</blockquote>
<p>
His list includes three big ones that, if forgotten, could end up being detrimental to your application (sooner or later) - poor housekeeping/organization of code, forgetting punctuation and forgetting to validate input from users.
</p>]]></description>
      <pubDate>Wed, 19 Oct 2011 09:17:59 -0500</pubDate>
    </item>
  </channel>
</rss>
