<?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 on: Dual citizenship and object identity</title>
	<atom:link href="http://craigrandall.net/archives/2005/07/dual-citizenship-object-identity/feed/" rel="self" type="application/rss+xml" />
	<link>http://craigrandall.net/archives/2005/07/dual-citizenship-object-identity/</link>
	<description>Thoughts about software architecture, books and life</description>
	<lastBuildDate>Wed, 04 Jan 2012 18:00:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: ErikThomas</title>
		<link>http://craigrandall.net/archives/2005/07/dual-citizenship-object-identity/comment-page-1/#comment-42</link>
		<dc:creator>ErikThomas</dc:creator>
		<pubDate>Thu, 14 Jul 2005 04:55:55 +0000</pubDate>
		<guid isPermaLink="false">http://craigrandall.net/?p=142#comment-42</guid>
		<description>Hey Craig:

Just to defend C++ in a small way, with regard to your &quot;Dual Citizenship&quot; musings--specifically to the &quot;nightmare&quot; of C++ multiple inheritance, I guess that as with anything powerful, one must exercise care when using it. Multiple inheritance in C++, when done correctly is a very elegant OO approach to solving complex problems, but one must exercise the discipline to inherit only pure virtual interfaces. There are several useful design patterns (including Adapter and Stairway To Heaven) that are nicely implemented using multiple inheritance in C++, and there are no major weaknesses in doing it unless you let a 3 year old try it. 

Of course few (if any) experienced C++ developers condone multiple inheritence of implementation, so we agree on that, but we also know that it isn&#039;t needed. Good C++ uses multiple inheritance exactly as Java inherits multiple interfaces. The only (mostly symbolic) difference is that in Java, you use the &quot;interface&quot; keyword which puts cops in your own backyard to prevent adding implementation, whereas in C++, you use pure virtual functions, and refrain from adding any implementation by using personal and organizational discipline. I don&#039;t really see the difference as enough to demonize C++, but that&#039;s just my opinion, and we all know what opinions are like. ;O) 

Of course I sympathize from an organizational point of view why it is beneficial to move away from such a dangerous and complex language as C++ so that we can protect ourselves from misuse of powerful tools, and protect ourselves from lazy or inept developers, and move software development down the continuum towards unskilled (or low-skilled) labor that is more cost effective, e.g., third world Nike shops, etc. 

But I am a hold-out and a hopeless romantic. I want to experience the same sense of satisfaction that an author, painter, or musician experiences when s/he completes a work of art using a very unstructured medium. I will always resist the attempt by MBA mentality to &quot;dumb down&quot; software development to maximize shareholder wealth, because I believe a really good C++ developer can implement great object-oriented designs that comply with all the Agile principles, though it is harder to do and requires a greater level of expertise.

On the other hand, if I was a language designer, I might take your point of view, because we could (potentially) design languages that prevent the pitfalls of multiple inheritence, mainly because it would be fun to do.

But when we apply ISP to segregate sets of interfaces that leverage a single implementation but serve multiple clients with slightly different needs, multiple inheritence of pure virtual interface classes using C++ can be a very elegant solution, as can Java or C# using multiple interface inheritence. 

Let me ask you, if C#, Java, and C++ did not allow inheriting more than a single interface, how would you apply the Agile ISP? Is ISP a good or bad principle, or perhaps exists because of the limitations inherent in current mainstream OO languages?

Just some musings of my own. Thanks for listening, and be gentle in your response! :O) 

Now that I&#039;m back to C++ development I&#039;m kind of charged up by how free I feel and how equipped I am to exceed expectations by applying some of the best lessons I learned from 4 years of Java development--and my newfound interest in Agile principles and some cool new (to me) design patterns--to some pretty challenging legacy C++ code. Incidentally, I just love some of Robert Martin&#039;s C++ examples and I&#039;d almost forgotten how useful destructors are are managing resources!

Erik</description>
		<content:encoded><![CDATA[<p>Hey Craig:</p>
<p>Just to defend C++ in a small way, with regard to your &#8220;Dual Citizenship&#8221; musings&#8211;specifically to the &#8220;nightmare&#8221; of C++ multiple inheritance, I guess that as with anything powerful, one must exercise care when using it. Multiple inheritance in C++, when done correctly is a very elegant OO approach to solving complex problems, but one must exercise the discipline to inherit only pure virtual interfaces. There are several useful design patterns (including Adapter and Stairway To Heaven) that are nicely implemented using multiple inheritance in C++, and there are no major weaknesses in doing it unless you let a 3 year old try it. </p>
<p>Of course few (if any) experienced C++ developers condone multiple inheritence of implementation, so we agree on that, but we also know that it isn&#8217;t needed. Good C++ uses multiple inheritance exactly as Java inherits multiple interfaces. The only (mostly symbolic) difference is that in Java, you use the &#8220;interface&#8221; keyword which puts cops in your own backyard to prevent adding implementation, whereas in C++, you use pure virtual functions, and refrain from adding any implementation by using personal and organizational discipline. I don&#8217;t really see the difference as enough to demonize C++, but that&#8217;s just my opinion, and we all know what opinions are like. ;O) </p>
<p>Of course I sympathize from an organizational point of view why it is beneficial to move away from such a dangerous and complex language as C++ so that we can protect ourselves from misuse of powerful tools, and protect ourselves from lazy or inept developers, and move software development down the continuum towards unskilled (or low-skilled) labor that is more cost effective, e.g., third world Nike shops, etc. </p>
<p>But I am a hold-out and a hopeless romantic. I want to experience the same sense of satisfaction that an author, painter, or musician experiences when s/he completes a work of art using a very unstructured medium. I will always resist the attempt by MBA mentality to &#8220;dumb down&#8221; software development to maximize shareholder wealth, because I believe a really good C++ developer can implement great object-oriented designs that comply with all the Agile principles, though it is harder to do and requires a greater level of expertise.</p>
<p>On the other hand, if I was a language designer, I might take your point of view, because we could (potentially) design languages that prevent the pitfalls of multiple inheritence, mainly because it would be fun to do.</p>
<p>But when we apply ISP to segregate sets of interfaces that leverage a single implementation but serve multiple clients with slightly different needs, multiple inheritence of pure virtual interface classes using C++ can be a very elegant solution, as can Java or C# using multiple interface inheritence. </p>
<p>Let me ask you, if C#, Java, and C++ did not allow inheriting more than a single interface, how would you apply the Agile ISP? Is ISP a good or bad principle, or perhaps exists because of the limitations inherent in current mainstream OO languages?</p>
<p>Just some musings of my own. Thanks for listening, and be gentle in your response! :O) </p>
<p>Now that I&#8217;m back to C++ development I&#8217;m kind of charged up by how free I feel and how equipped I am to exceed expectations by applying some of the best lessons I learned from 4 years of Java development&#8211;and my newfound interest in Agile principles and some cool new (to me) design patterns&#8211;to some pretty challenging legacy C++ code. Incidentally, I just love some of Robert Martin&#8217;s C++ examples and I&#8217;d almost forgotten how useful destructors are are managing resources!</p>
<p>Erik</p>
]]></content:encoded>
	</item>
</channel>
</rss>

