<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.1.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Ruby&#8217;s &#8220;private&#8221;: not as Private as You Expect</title>
	<link>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/</link>
	<description>Thoughts on coding, agile, rails and things typed at runtime.</description>
	<pubDate>Thu, 09 Sep 2010 10:13:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.2</generator>

	<item>
		<title>By: jc</title>
		<link>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-9</link>
		<author>jc</author>
		<pubDate>Fri, 27 Apr 2007 01:50:24 +0000</pubDate>
		<guid>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-9</guid>
					<description>Private methods bad for reusability?

I love ruby and all, but encapsulation is actually GOOD for reusability. I wish they'd fix some of this stuff up to make it a little more sturdy.

So many things in Ruby are along the lines of "you can, but you shouldn't". Guess this is just one of those things...</description>
		<content:encoded><![CDATA[<p>Private methods bad for reusability?</p>
<p>I love ruby and all, but encapsulation is actually GOOD for reusability. I wish they&#8217;d fix some of this stuff up to make it a little more sturdy.</p>
<p>So many things in Ruby are along the lines of &#8220;you can, but you shouldn&#8217;t&#8221;. Guess this is just one of those things&#8230;</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Nicolas Sanguinetti</title>
		<link>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-10</link>
		<author>Nicolas Sanguinetti</author>
		<pubDate>Fri, 27 Apr 2007 03:25:58 +0000</pubDate>
		<guid>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-10</guid>
					<description>Actually, data encapsulation is bad for reusability in general, yes. As a library vendor, you never know the needs of your clients, so maybe you thought out a certain way to interact with your library from the outside, but maybe you have a lot of users that need to interact with it in a different way, that you hadn't foresaw.

So, you publish your code and your classes without all the "private" thingies, and then you publish your interfaces with the contract you designed. That just guides people along the "suggested path" for your library, but allows clients to leverage the full power of your code :)

And please, dont answer with the "we have to protect them from possible mistakes of using the code", if you dont assume programmers are intelligent enough, then why the hell are you giving them your library, if you are so smarter than them? :P</description>
		<content:encoded><![CDATA[<p>Actually, data encapsulation is bad for reusability in general, yes. As a library vendor, you never know the needs of your clients, so maybe you thought out a certain way to interact with your library from the outside, but maybe you have a lot of users that need to interact with it in a different way, that you hadn&#8217;t foresaw.</p>
<p>So, you publish your code and your classes without all the &#8220;private&#8221; thingies, and then you publish your interfaces with the contract you designed. That just guides people along the &#8220;suggested path&#8221; for your library, but allows clients to leverage the full power of your code :)</p>
<p>And please, dont answer with the &#8220;we have to protect them from possible mistakes of using the code&#8221;, if you dont assume programmers are intelligent enough, then why the hell are you giving them your library, if you are so smarter than them? :P</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Mark Murphy</title>
		<link>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-12</link>
		<author>Mark Murphy</author>
		<pubDate>Fri, 27 Apr 2007 10:19:12 +0000</pubDate>
		<guid>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-12</guid>
					<description>FYI, Ruby and Java were first developed around the same time, and both were released to the public in 1995. If the private keyword existed from the beginning, then Ruby would not have been following Java's lead, since it's unlikely that Matz (Ruby) or James Gosling (Java) knew much about what the other was doing. Both languages followed the release of C++.</description>
		<content:encoded><![CDATA[<p>FYI, Ruby and Java were first developed around the same time, and both were released to the public in 1995. If the private keyword existed from the beginning, then Ruby would not have been following Java&#8217;s lead, since it&#8217;s unlikely that Matz (Ruby) or James Gosling (Java) knew much about what the other was doing. Both languages followed the release of C++.</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Carl Graff</title>
		<link>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-14</link>
		<author>Carl Graff</author>
		<pubDate>Fri, 27 Apr 2007 15:38:44 +0000</pubDate>
		<guid>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-14</guid>
					<description>Actually I think data encapsulation protects the author just as much as the users of a "library". It allows the underlying implementation to be refactored with a degree of protection.

In any event you can override the private methods dynamically for example the CSV library:

class CSV
  class </description>
		<content:encoded><![CDATA[<p>Actually I think data encapsulation protects the author just as much as the users of a &#8220;library&#8221;. It allows the underlying implementation to be refactored with a degree of protection.</p>
<p>In any event you can override the private methods dynamically for example the CSV library:</p>
<p>class CSV<br />
  class</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Carl Graff</title>
		<link>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-15</link>
		<author>Carl Graff</author>
		<pubDate>Fri, 27 Apr 2007 15:40:59 +0000</pubDate>
		<guid>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-15</guid>
					<description>Oops I think the code example got cut off:

class CSV
  class </description>
		<content:encoded><![CDATA[<p>Oops I think the code example got cut off:</p>
<p>class CSV<br />
  class</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Carl Graff</title>
		<link>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-16</link>
		<author>Carl Graff</author>
		<pubDate>Fri, 27 Apr 2007 15:49:20 +0000</pubDate>
		<guid>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-16</guid>
					<description>Ok one more try :-(

&lt;code&gt;
class CSV
  class 
</description>
		<content:encoded><![CDATA[<p>Ok one more try :-(</p>
<p><code><br />
class CSV<br />
  class</code></p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Carl Graff</title>
		<link>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-17</link>
		<author>Carl Graff</author>
		<pubDate>Fri, 27 Apr 2007 16:32:47 +0000</pubDate>
		<guid>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-17</guid>
					<description>Well C@3p. This guy is way smarter than me and a good video:
http://video.google.com/videoplay?docid=-3733345136856180693</description>
		<content:encoded><![CDATA[<p>Well <a href="mailto:C@3p.">C@3p.</a> This guy is way smarter than me and a good video:<br />
<a href="http://video.google.com/videoplay?docid=-3733345136856180693" rel="nofollow">http://video.google.com/videoplay?docid=-3733345136856180693</a></p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Ida</title>
		<link>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-9378</link>
		<author>Ida</author>
		<pubDate>Sun, 30 Aug 2009 23:50:08 +0000</pubDate>
		<guid>http://www.redrobinsoftware.net/blog/2007/04/24/rubys-private-not-as-private-as-you-expect/#comment-9378</guid>
					<description>Great blog you got here...keep up the good work.</description>
		<content:encoded><![CDATA[<p>Great blog you got here&#8230;keep up the good work.</p>
]]></content:encoded>
				</item>
</channel>
</rss>
