<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Berry Langerak</title>
	<atom:link href="http://berryllium.nl/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://berryllium.nl</link>
	<description>Thoughts on life and programming</description>
	<lastBuildDate>Fri, 13 Apr 2012 16:18:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Comment on Getters and setters: evil or necessary evil? by Theodore R. Smith</title>
		<link>http://berryllium.nl/2011/02/getters-and-setters-evil-or-necessary-evil/#comment-218</link>
		<dc:creator>Theodore R. Smith</dc:creator>
		<pubDate>Fri, 13 Apr 2012 16:18:40 +0000</pubDate>
		<guid isPermaLink="false">http://berryllium.nl/?p=130#comment-218</guid>
		<description>Inside your view, do this:

balance;
    }
}

Then only in your controller you would request the ViewableBankAccount instead of BankAccount, but only when you need the data.

If you&#039;re not using dependency injection, this will be a pain, but your app wouldn&#039;t be very well designed any way, if that&#039;s the case.</description>
		<content:encoded><![CDATA[<p>Inside your view, do this:</p>
<p>balance;<br />
    }<br />
}</p>
<p>Then only in your controller you would request the ViewableBankAccount instead of BankAccount, but only when you need the data.</p>
<p>If you&#8217;re not using dependency injection, this will be a pain, but your app wouldn&#8217;t be very well designed any way, if that&#8217;s the case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on debian: error: Cannot find php_pdo_driver.h by gnusam</title>
		<link>http://berryllium.nl/2012/02/configure-error-cannot-find-php_pdo_driver-h-in-debian/#comment-217</link>
		<dc:creator>gnusam</dc:creator>
		<pubDate>Tue, 03 Apr 2012 14:45:43 +0000</pubDate>
		<guid isPermaLink="false">http://berryllium.nl/?p=196#comment-217</guid>
		<description>Works on ubuntu too :)</description>
		<content:encoded><![CDATA[<p>Works on ubuntu too <img src='http://berryllium.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Generate random password PostgreSQL by Alex Smith</title>
		<link>http://berryllium.nl/2010/07/generate-random-password-postgresql/#comment-205</link>
		<dc:creator>Alex Smith</dc:creator>
		<pubDate>Fri, 03 Jun 2011 14:50:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.berryllium.nl/?p=70#comment-205</guid>
		<description>This SQL generates a 6 chars random password (see last line if you want to generate a bigger/smaller one) using A table&#039;s charset:

SELECT ARRAY_TO_STRING(ARRAY_AGG(SUBSTR(A.chars, (RANDOM()*1000)::int%(LENGTH(A.chars))+1, 1)), &#039;&#039;)
  FROM (SELECT &#039;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%*&#039;::varchar AS chars) A,
       (SELECT generate_series(1, 6, 1) AS line) B

I think it also solves the problem.

Tested in postgresql 8.4.</description>
		<content:encoded><![CDATA[<p>This SQL generates a 6 chars random password (see last line if you want to generate a bigger/smaller one) using A table&#8217;s charset:</p>
<p>SELECT ARRAY_TO_STRING(ARRAY_AGG(SUBSTR(A.chars, (RANDOM()*1000)::int%(LENGTH(A.chars))+1, 1)), &#8221;)<br />
  FROM (SELECT &#8216;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%*&#8217;::varchar AS chars) A,<br />
       (SELECT generate_series(1, 6, 1) AS line) B</p>
<p>I think it also solves the problem.</p>
<p>Tested in postgresql 8.4.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getters and setters: evil or necessary evil? by OZ</title>
		<link>http://berryllium.nl/2011/02/getters-and-setters-evil-or-necessary-evil/#comment-197</link>
		<dc:creator>OZ</dc:creator>
		<pubDate>Mon, 23 May 2011 16:21:50 +0000</pubDate>
		<guid isPermaLink="false">http://berryllium.nl/?p=130#comment-197</guid>
		<description>Getters and Setters aren&#039;t evil. Idea of Encapsulation is not just hide fields, but hide, how class works. Getters and setters can be declared in interface, so you can replace one abject by another - and it is what for encapsulation was invented! 

`withdraw` and `deposit` it&#039;s setters. All this code can be successfully done in `setBalance` method, almost nothing will be changed. All these checks, comparison - it&#039;s usual work of setters. 

Why public fields are evil? Because object can&#039;t control their changing and because they can&#039;t be declared in interfaces. Getters and setters can do it, so it&#039;s perfect tool of OOP. 

Accessors can be written silly, of course, but it doesn&#039;t mean that they are evil. Any method in the class can be written silly.</description>
		<content:encoded><![CDATA[<p>Getters and Setters aren&#8217;t evil. Idea of Encapsulation is not just hide fields, but hide, how class works. Getters and setters can be declared in interface, so you can replace one abject by another &#8211; and it is what for encapsulation was invented! </p>
<p>`withdraw` and `deposit` it&#8217;s setters. All this code can be successfully done in `setBalance` method, almost nothing will be changed. All these checks, comparison &#8211; it&#8217;s usual work of setters. </p>
<p>Why public fields are evil? Because object can&#8217;t control their changing and because they can&#8217;t be declared in interfaces. Getters and setters can do it, so it&#8217;s perfect tool of OOP. </p>
<p>Accessors can be written silly, of course, but it doesn&#8217;t mean that they are evil. Any method in the class can be written silly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getters and setters: evil or necessary evil? by The great (PHP) getter/setter debate &#124; Gargoyle</title>
		<link>http://berryllium.nl/2011/02/getters-and-setters-evil-or-necessary-evil/#comment-177</link>
		<dc:creator>The great (PHP) getter/setter debate &#124; Gargoyle</dc:creator>
		<pubDate>Thu, 28 Apr 2011 09:02:45 +0000</pubDate>
		<guid isPermaLink="false">http://berryllium.nl/?p=130#comment-177</guid>
		<description>[...] on this front that Berry Langerak puts forward a good case, and where I want to add my two cents worth. Berry attempts to stress that [...]</description>
		<content:encoded><![CDATA[<div style="background-color: #F8F7F6; border: 1px solid #D6D3D3;">
<p>[...] on this front that Berry Langerak puts forward a good case, and where I want to add my two cents worth. Berry attempts to stress that [...]</p>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getters and setters: evil or necessary evil? by Berry</title>
		<link>http://berryllium.nl/2011/02/getters-and-setters-evil-or-necessary-evil/#comment-175</link>
		<dc:creator>Berry</dc:creator>
		<pubDate>Fri, 25 Mar 2011 15:24:34 +0000</pubDate>
		<guid isPermaLink="false">http://berryllium.nl/?p=130#comment-175</guid>
		<description>Thanks! Yeah, I&#039;ll try to write up on some stuff this weekend, so keep your eye on the blog! ;)</description>
		<content:encoded><![CDATA[<p>Thanks! Yeah, I&#8217;ll try to write up on some stuff this weekend, so keep your eye on the blog! <img src='http://berryllium.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getters and setters: evil or necessary evil? by Phill Pafford</title>
		<link>http://berryllium.nl/2011/02/getters-and-setters-evil-or-necessary-evil/#comment-174</link>
		<dc:creator>Phill Pafford</dc:creator>
		<pubDate>Fri, 25 Mar 2011 14:35:32 +0000</pubDate>
		<guid isPermaLink="false">http://berryllium.nl/?p=130#comment-174</guid>
		<description>Hi Berry, 

Great post! Any chance you are doing more on this topic? or should I say style of development?</description>
		<content:encoded><![CDATA[<p>Hi Berry, </p>
<p>Great post! Any chance you are doing more on this topic? or should I say style of development?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getters and setters: evil or necessary evil? by Compilado de enlaces &#171; Programación &#8211; por droope</title>
		<link>http://berryllium.nl/2011/02/getters-and-setters-evil-or-necessary-evil/#comment-173</link>
		<dc:creator>Compilado de enlaces &#171; Programación &#8211; por droope</dc:creator>
		<pubDate>Thu, 24 Mar 2011 06:09:55 +0000</pubDate>
		<guid isPermaLink="false">http://berryllium.nl/?p=130#comment-173</guid>
		<description>[...] Excelente artículo sobre si usar o no usar getters y setters para nuestros objetos, y sobre cuando es práctico hacerlo. [...]</description>
		<content:encoded><![CDATA[<div style="background-color: #F8F7F6; border: 1px solid #D6D3D3;">
<p>[...] Excelente artículo sobre si usar o no usar getters y setters para nuestros objetos, y sobre cuando es práctico hacerlo. [...]</p>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getters and setters: evil or necessary evil? by Berry</title>
		<link>http://berryllium.nl/2011/02/getters-and-setters-evil-or-necessary-evil/#comment-159</link>
		<dc:creator>Berry</dc:creator>
		<pubDate>Mon, 21 Feb 2011 09:00:18 +0000</pubDate>
		<guid isPermaLink="false">http://berryllium.nl/?p=130#comment-159</guid>
		<description>Hi Alex,

&gt; If you fail to see how adding an accessor only when the need becomes 
&gt; clear will break an existing API then imagine a situation where your 
&gt; team uses a public varible 1000+ times and then you need to alter the 
&gt; value they receive based on some dynamic environment.

Agreed: if your team uses a public variable 1000+ times, and they use it and apply logic to it, the brown substance has hit the fan. 

&gt; The example is simple because I just wanted to say – nobody(!) ever 
&gt; uses accessor methods to move business logic outside an object but 
&gt; to achieve different kinds of polymorphism or make it achievable.

I hate to break it to you, but you&#039;re contradicting yourself somewhat. You&#039;re telling me that nobody(!) will ever use accessor methods to move business logic outside of an object, but you&#039;re also telling me your team uses a public parameter to move business logic outside of an object?  

&gt; I hope you really meant you are against public properties and not 
&gt; against accessor methods. Otherwise the point is senseless, a usual 
&gt; programmer does not do what you have explained (and we don’t count 
&gt; newbies).

Perhaps not your colleagues, but I see it happening a lot in PHP projects. I&#039;ll try to find some real life examples for you to enjoy.</description>
		<content:encoded><![CDATA[<p>Hi Alex,</p>
<p>> If you fail to see how adding an accessor only when the need becomes<br />
> clear will break an existing API then imagine a situation where your<br />
> team uses a public varible 1000+ times and then you need to alter the<br />
> value they receive based on some dynamic environment.</p>
<p>Agreed: if your team uses a public variable 1000+ times, and they use it and apply logic to it, the brown substance has hit the fan. </p>
<p>> The example is simple because I just wanted to say – nobody(!) ever<br />
> uses accessor methods to move business logic outside an object but<br />
> to achieve different kinds of polymorphism or make it achievable.</p>
<p>I hate to break it to you, but you&#8217;re contradicting yourself somewhat. You&#8217;re telling me that nobody(!) will ever use accessor methods to move business logic outside of an object, but you&#8217;re also telling me your team uses a public parameter to move business logic outside of an object?  </p>
<p>> I hope you really meant you are against public properties and not<br />
> against accessor methods. Otherwise the point is senseless, a usual<br />
> programmer does not do what you have explained (and we don’t count<br />
> newbies).</p>
<p>Perhaps not your colleagues, but I see it happening a lot in PHP projects. I&#8217;ll try to find some real life examples for you to enjoy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getters and setters: evil or necessary evil? by Alex Prider</title>
		<link>http://berryllium.nl/2011/02/getters-and-setters-evil-or-necessary-evil/#comment-156</link>
		<dc:creator>Alex Prider</dc:creator>
		<pubDate>Fri, 18 Feb 2011 23:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://berryllium.nl/?p=130#comment-156</guid>
		<description>Berry. If you  fail to see how adding an accessor only when the need becomes clear will break an existing API then imagine a situation where your team uses a public varible 1000+ times and then you need to alter the value they receive based on some dynamic environment. You will have to update the code in 1000+ different places (switching to method calls).

The example is simple because I just wanted to say - nobody(!) ever uses  accessor methods to move business logic outside an object but to achieve different kinds of polymorphism or make it achievable.

I hope you really meant you are against public properties and not against accessor methods. Otherwise the point is senseless, a usual programmer does not do what you have explained (and we don&#039;t count newbies).</description>
		<content:encoded><![CDATA[<p>Berry. If you  fail to see how adding an accessor only when the need becomes clear will break an existing API then imagine a situation where your team uses a public varible 1000+ times and then you need to alter the value they receive based on some dynamic environment. You will have to update the code in 1000+ different places (switching to method calls).</p>
<p>The example is simple because I just wanted to say &#8211; nobody(!) ever uses  accessor methods to move business logic outside an object but to achieve different kinds of polymorphism or make it achievable.</p>
<p>I hope you really meant you are against public properties and not against accessor methods. Otherwise the point is senseless, a usual programmer does not do what you have explained (and we don&#8217;t count newbies).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

