<?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, 22 May 2013 06:14:38 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[RubySource.com: Confessions of a Converted PHP Developer: Namespace Superhero!]]></title>
      <guid>http://www.phpdeveloper.org/news/16654</guid>
      <link>http://www.phpdeveloper.org/news/16654</link>
      <description><![CDATA[<p>
RubySource.com has posted another in their "confessions of a converted PHP developer" series (<a href="http://phpdeveloper.org/tag/rubysource">more here</a>) with a new <a href="http://rubysource.com/confessions-of-a-converted-php-developer-namespace-superheroes/">article comparing namespacing between the two languages</a>.
</p>
<blockquote>
The moment you start writing code that grows beyond a few classes, you start to realise that you need a way to group files and logic. While this is easy to do, it can become quite difficult to ensure that you have class names that are unique and don't end up accidentally clashing with other classes in your own code, or classes in other people's code that you are using.
</blockquote>
<p>
He talks about PHP's namespacing, a relatively recent addition, and how pre-5.3 "pseudo-namespacing" was done through class and directory names with autoloading. He compares this to Ruby's module support that provides a sort of built in namespacing support. He includes a multiple namespace Ruby example and shows how to nest modules for even more fine-grained separation.
</p>]]></description>
      <pubDate>Fri, 29 Jul 2011 12:43:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[RubySource.com: Confessions of a Converted PHP Developer: Animal Abuse]]></title>
      <guid>http://www.phpdeveloper.org/news/16523</guid>
      <link>http://www.phpdeveloper.org/news/16523</link>
      <description><![CDATA[<p>
In another entry in his "Confessions of a Converted PHP Developer" series <i>Mal Curtis</i> about a <a href="http://rubysource.com/confessions-of-a-converted-php-developer-animal-abuse/">typical class development path</a> PHP developers take and how it can be a limiting, linear progression from one step to another.
</p>
<blockquote>
In converting to Ruby I realized how strict PHP is in its class hierarchy. This surprised me as I'd always viewed PHP as a very loose language, mainly due to its loose typing and lack of formal code structure guidelines. [...] I find most PHP developers learn starting by using inline PHP as a low learning curve entry point into dynamic web languages and then move on to fuller, more complex, applications.
</blockquote>
<p>
He includes a few code samples comparing how Ruby, while still allowing the same kind of structure, also lets you redefine classes on the fly. His example shows redefining a method in a Ruby class using a method commonly called "monkey patching". It's good that he points out a downfall of the approach too:
</p>
<blockquote>
I must note that Monkey Patching is often a quick fix solution that can create headaches for future developers (or for yourself, if your memory is like mine) for several reasons. [...] Use at your own risk! 
</blockquote>
<p>
There's <a href="http://www.google.com/#sclient=psy&hl=en&authuser=0&source=hp&q=monkey+patch+php">several different articles</a> all over the web talking about the "monkey patching" approach and if it's possible/useful in PHP.
</p>]]></description>
      <pubDate>Mon, 27 Jun 2011 13:40:02 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[RubySource.com: Confessions of a Converted PHP Developer: On Visibility and Privates]]></title>
      <guid>http://www.phpdeveloper.org/news/16331</guid>
      <link>http://www.phpdeveloper.org/news/16331</link>
      <description><![CDATA[<p>
From RubySource.com there's a new post from a confessed developer who moved from PHP to Ruby about <a href="http://rubysource.com/php-developer-on-visibility-and-privates/">PHP's private visibility rules</a> and how they compare to Ruby's.
</p>
<blockquote>
Alright class - today I'm here to talk about the differences and similarities that PHP and Ruby have when it comes to object properties, methods, and their visibility - how you create variables inside classes, and how you can interact with them.
</blockquote>
<p>
He compares the private properties in PHP classes to the corresponding handling in Ruby, including the getters and setters to go with them. There's also a look at class visibility settings in Ruby.
</p>]]></description>
      <pubDate>Thu, 12 May 2011 10:49:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[RubySource.com: Confessions of a Converted PHP Developer: Ugly Code]]></title>
      <guid>http://www.phpdeveloper.org/news/16191</guid>
      <link>http://www.phpdeveloper.org/news/16191</link>
      <description><![CDATA[<p>
On RubySource.com there's a recent post with a bit of a confession from an ex-PHP developer who's moved over to Ruby about <a href="http://rubysource.com/confessions-of-a-converted-php-developer-ugly-code/">some of he is experiences</a> in making the shift and why he's a convert now.
</p>
<blockquote>
I've been a PHP developer for nearly a decade, and in January this year I started developing in Ruby. While initially a sceptic, I'm now a convert - and I'm here to share my experiences with you. [...]  I'd like to think of myself as a fairly good PHP developer, and the idea of moving to Rails was both scary and exciting. [...] In Ruby's defence, these are frustrations that are well made up for with the delights of finding out how easy other things are to do - and any learning process has its frustrations.
</blockquote>
<p>
He compares a bit of code that would take a list of email addresses and pull out the domain parts of each, grabbing only the unique ones. He includes some PHP code (using anonymous functions in PHP 5.3) to get the job done and compares it to the Ruby method that's a bit more fluid and readable. He talks about some of his frustrations during the learning process of creating code like this and includes his steps as he evolved through it.
</p>]]></description>
      <pubDate>Wed, 13 Apr 2011 13:12:02 -0500</pubDate>
    </item>
  </channel>
</rss>
