<?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, 22 Nov 2008 00:18:13 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Alex Netkachov's Blog: Are setters evil?]]></title>
      <guid>http://www.phpdeveloper.org/news/10425</guid>
      <link>http://www.phpdeveloper.org/news/10425</link>
      <description><![CDATA[<p>
<i>Alex Netkachov</i> has posted his <a href="http://www.alexatnet.com/node/151">own response</a> to <a href="http://www.phpdeveloper.org/news/10420">this opinion</a> on the Typical Programmer on getters and setters in object-oriented applications.
</p>
<blockquote>
"Do not use getters and setters" looks like a hastily advise, but its meaning is very important and it is "do not break encapsulation", which moves us to the question what the encapsulation is.
</blockquote>
<p>
He notes that encapsulation is, in essence, hiding parts of the code away so that the user/other coders only see a little bit of the magic that happens. He argues that getters and setters are a valid part of the encapsulation process and that designing a good, easy to use system almost requires them.
</p>]]></description>
      <pubDate>Tue, 17 Jun 2008 09:36:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Typical Programmer Blog: Doing it wrong: getters and setters]]></title>
      <guid>http://www.phpdeveloper.org/news/10420</guid>
      <link>http://www.phpdeveloper.org/news/10420</link>
      <description><![CDATA[<p>
According to <a href="http://typicalprogrammer.com/?p=23">this new post</a> on the Typical Programmer blog, using getters and setters in your scripts only adds in a bit of unnecessary coupling and complexity to your scripts that you just don't need.
</p>
<blockquote>
Today most of the popular programming languages support objects, limiting scope, modularity, passing by value, and sophisticated built-in types. There should be no reason to deliberately expose an object's data to the rest of the code because the language can enforce encapsulation and data hiding.
</blockquote>
<p>
While not specific to PHP, <a href="http://typicalprogrammer.com/?p=23">the post</a> does recommend against them because of one simple reason common to all languages that make them possible - they "break the encapsulation OOP offers". For them, they're like a cheat to get around bad coding practices and are not needed to make a successful application work.
</p>]]></description>
      <pubDate>Mon, 16 Jun 2008 11:19:17 -0500</pubDate>
    </item>
  </channel>
</rss>
