<?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"
	>
<channel>
	<title>Comments on: C++ vs. C# - a Checklist from a C++ Programmers Point of View</title>
	<atom:link href="http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/</link>
	<description>A Blog on Parallel Programming and Concurrency by Michael Suess</description>
	<pubDate>Mon, 12 May 2008 10:11:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Dragontamer</title>
		<link>http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-54425</link>
		<dc:creator>Dragontamer</dc:creator>
		<pubDate>Sun, 30 Mar 2008 00:50:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-54425</guid>
		<description>I don't really know C# and I appreciate the list... but I do know C++ and would like to make a few comments if you don't mind.

    * garbage collection

C++ has 3rd party garbage collection, and in all flavors too. You can get a reference counting GC or use a Mark and Sweep one or whatever other algorithms are out there. They work pretty well and override the global operator "new" function. Check out Stroustrup's FAQs for pointers on this part. http://www.research.att.com/~bs/bs_faq.html#garbage-collection

    * array bounds checking

Just pointing out that you can use std::vector.at() and you'll get bounds checking. I find it hard to think of situations when I'd use an array over a std::vector.

    * built-in support for threads

A valid complaint, just noting that C++0x will hopefully rectify that situation :-) (Stroustrup says "C++0x will almost certainly include a threads library." in his FAQ).

    * no fall-through on switch-statements
    * arithmetic operations can be checked for overflow if required

These sound pretty awesome. I'll have to look into C# just for these feature alone.

    * objects must have a definite value before being used

I'm somewhat confused by what you mean about this. If you don't provide a default constructor in C++, you are forced to initialize every object, or else you get a compile time error. Perhaps you mean primitives must have definite values?</description>
		<content:encoded><![CDATA[<p>I don&#8217;t really know C# and I appreciate the list&#8230; but I do know C++ and would like to make a few comments if you don&#8217;t mind.</p>
<p>    * garbage collection</p>
<p>C++ has 3rd party garbage collection, and in all flavors too. You can get a reference counting GC or use a Mark and Sweep one or whatever other algorithms are out there. They work pretty well and override the global operator &#8220;new&#8221; function. Check out Stroustrup&#8217;s FAQs for pointers on this part. <a href="http://www.research.att.com/~bs/bs_faq.html#garbage-collection" rel="nofollow">http://www.research.att.com/~bs/bs_faq.html#garbage-collection</a></p>
<p>    * array bounds checking</p>
<p>Just pointing out that you can use std::vector.at() and you&#8217;ll get bounds checking. I find it hard to think of situations when I&#8217;d use an array over a std::vector.</p>
<p>    * built-in support for threads</p>
<p>A valid complaint, just noting that C++0x will hopefully rectify that situation <img src='http://www.thinkingparallel.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> (Stroustrup says &#8220;C++0x will almost certainly include a threads library.&#8221; in his FAQ).</p>
<p>    * no fall-through on switch-statements<br />
    * arithmetic operations can be checked for overflow if required</p>
<p>These sound pretty awesome. I&#8217;ll have to look into C# just for these feature alone.</p>
<p>    * objects must have a definite value before being used</p>
<p>I&#8217;m somewhat confused by what you mean about this. If you don&#8217;t provide a default constructor in C++, you are forced to initialize every object, or else you get a compile time error. Perhaps you mean primitives must have definite values?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: programmer</title>
		<link>http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-41767</link>
		<dc:creator>programmer</dc:creator>
		<pubDate>Mon, 21 Jan 2008 14:40:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-41767</guid>
		<description>"when a virtual method is called in a constructor, the method in the most derived class is used" - *very* dangerous behaviour, c++ is better in that aspect

"value types live on the stack, reference types on the heap" - it depends on compiler optimizations, in c++ you have the same possiblity

"deterministic destruction (allows RAII)" - you can use that in C#

In my opinion you should lern little more about programming.</description>
		<content:encoded><![CDATA[<p>&#8220;when a virtual method is called in a constructor, the method in the most derived class is used&#8221; - *very* dangerous behaviour, c++ is better in that aspect</p>
<p>&#8220;value types live on the stack, reference types on the heap&#8221; - it depends on compiler optimizations, in c++ you have the same possiblity</p>
<p>&#8220;deterministic destruction (allows RAII)&#8221; - you can use that in C#</p>
<p>In my opinion you should lern little more about programming.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steve</title>
		<link>http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-35389</link>
		<dc:creator>steve</dc:creator>
		<pubDate>Wed, 12 Dec 2007 05:26:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-35389</guid>
		<description>This comparison and discussion is interesting for both the content
and the opinions of the participants.  The thought that a language
like C# can be as efficient as C++ is false.  The statement C++ can
be as efficient as C# is true.    Features such as garbage collection
are not free - I'm sorry to say.   Its also interesting to see how
some see a sortcoming (or just a decision not to support a feature)
as a benefit.  Now that's some great spin.  I've used multiple
inheritence a bunch in the past and the noone ever complained.
Sure, I can make all of my classes derive from the exception class
so that I can throw them.  No problem.  But to spin this as an 
advantage is comical.

The question I would ask is this:  if MSFT hadn't depricated all of its
C++ libraries in favor of C#, would there be as much of it out there
today?

My answer would be no...</description>
		<content:encoded><![CDATA[<p>This comparison and discussion is interesting for both the content<br />
and the opinions of the participants.  The thought that a language<br />
like C# can be as efficient as C++ is false.  The statement C++ can<br />
be as efficient as C# is true.    Features such as garbage collection<br />
are not free - I&#8217;m sorry to say.   Its also interesting to see how<br />
some see a sortcoming (or just a decision not to support a feature)<br />
as a benefit.  Now that&#8217;s some great spin.  I&#8217;ve used multiple<br />
inheritence a bunch in the past and the noone ever complained.<br />
Sure, I can make all of my classes derive from the exception class<br />
so that I can throw them.  No problem.  But to spin this as an<br />
advantage is comical.</p>
<p>The question I would ask is this:  if MSFT hadn&#8217;t depricated all of its<br />
C++ libraries in favor of C#, would there be as much of it out there<br />
today?</p>
<p>My answer would be no&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Suess</title>
		<link>http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-30804</link>
		<dc:creator>Michael Suess</dc:creator>
		<pubDate>Sun, 11 Nov 2007 20:17:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-30804</guid>
		<description>Anjuna Moon: Thanks for sharing your thoughts here. You raise some very valid points. Unfortunately, you have chosen to spice up your points with personal attacks, which does not help your credibility at all, in my humble opinion. 

You have also misunderstood the point of the post: I have listed all the differences I could find. Yes, that means some of them are contradictory. It is &lt;strong&gt;not&lt;/strong&gt; a list of things I like or don't like about these languages. As I have posted at the very beginning of the article, I don't even know enough about .NET to judge that.</description>
		<content:encoded><![CDATA[<p>Anjuna Moon: Thanks for sharing your thoughts here. You raise some very valid points. Unfortunately, you have chosen to spice up your points with personal attacks, which does not help your credibility at all, in my humble opinion. </p>
<p>You have also misunderstood the point of the post: I have listed all the differences I could find. Yes, that means some of them are contradictory. It is <strong>not</strong> a list of things I like or don&#8217;t like about these languages. As I have posted at the very beginning of the article, I don&#8217;t even know enough about .NET to judge that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anjuna Moon</title>
		<link>http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-29787</link>
		<dc:creator>Anjuna Moon</dc:creator>
		<pubDate>Tue, 06 Nov 2007 11:38:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-29787</guid>
		<description>Hm, almost half of your "positives" on the C++ list are actually the negatives that promoted the development of C#. As a veteran C++ developer I can see where you are coming from, but you shouldn't post views on something you haven't grasped.

Let's go through some of your misconceptions:

- Better performance : What do you base this upon? C# and  C++ are both just high-level programming languages. Performance is dependant on how the compilers interpret andr translate your code and nothing else. 

- Multiple inheritance &#38;&#38; pointers: These are two of the most important differences in my opinion. MI was nothing but a root of so many problems in a multi-developer environment. The same I can say about explicit pointers. By developing the interface and delegate-features in C# these problems have decreased a lot. 
Bottom-line in the MI-issue is - if you can't design a model using only interface-implementation and single-inheritance then you simply aren't fit to design it.

- Support for macros: I tend to agree a bit, but you should look into attributes of .Net to see that there is a whole lot you actually can do to interact with the compiler. Of course this applies to C++.net as well, but now I guess we are leaving the .Net part out of the discussion.

- It is interesting to see that you give a plus to both C# garbage collection as well as the old deterministic destruction of objects. I would like to see why this ambivalence exists. If you use C++ eg. for game-programming, sure - then a lot of your points are true, especially on the det.destruction-point. 
But since you are comparing C++  to C# we are not talking about these kind of applications  and therefore there is nothing that promotes your old memory-leaking problems that even the most experienced developer creates in old C++ vs. managed garbage collection.

- Support for globals: What kind of "global" are you missing in C#? If you haven't grasped the namespace-system then you should study some more. In a true object-oriented model there is need for only one global - the root class. If you don't know how to develop without using "free" globals, then you should study even further ;)

- Supports bitfields: True enough that the language itself doesn't support this, but again we are not discussing applications where pure mapping to machine-code is essential (if we were discussing that we wouldn't even talk about C#). However, since C# is mainly used in the .Net environment, this is not a problem since .Net offers the same bit-array-handling you have natively in C++ and a lot more manipulation-possibilities that are not there in C++. Thus, no negative.

- STL: You have got to be kidding me or you really have no idea of the extensiveness of the .Net-library. Nuff said on that! Jeez...

- Portability: This remains the argument in the Java-world, but the the fact is this is not (and has not been for a long time) an issue in corporate reality. The only major shift between platforms done on a global scale the last two decades have been from old Cobol-systems to either (or both) Unix/Linux and Windows. 
What an intelligent and cost-effective enterprise today does is to utilize the power of a platform and thus using the environment best suited for this purpose. Neither Java nor C++ classic can do this, just because of the platform-independentness that many of there libraries are built upon. Therefor they are actually far weaker choices as environments.

- any type can be thrown as exception (only classes derived from System.Exception in C#): Not sure what your getting at here so please expand that. You can catch all exceptions in try-blocks, even from unmanaged components, so what is your point?

- ability to enforce const-correctness: Dear old discussion in the C++ community but i tend to agree with Anders Hejlsberg on this subject and do not see this as a major downer.

Well, in conclusion - C++ is naturally the given choice in real-time or close to real-time application-development, but when comparing it to C# we are mainly in the .net-world: In this environment there is in my mind no comparison and C# comes out the winner.</description>
		<content:encoded><![CDATA[<p>Hm, almost half of your &#8220;positives&#8221; on the C++ list are actually the negatives that promoted the development of C#. As a veteran C++ developer I can see where you are coming from, but you shouldn&#8217;t post views on something you haven&#8217;t grasped.</p>
<p>Let&#8217;s go through some of your misconceptions:</p>
<p>- Better performance : What do you base this upon? C# and  C++ are both just high-level programming languages. Performance is dependant on how the compilers interpret andr translate your code and nothing else. </p>
<p>- Multiple inheritance &amp;&amp; pointers: These are two of the most important differences in my opinion. MI was nothing but a root of so many problems in a multi-developer environment. The same I can say about explicit pointers. By developing the interface and delegate-features in C# these problems have decreased a lot.<br />
Bottom-line in the MI-issue is - if you can&#8217;t design a model using only interface-implementation and single-inheritance then you simply aren&#8217;t fit to design it.</p>
<p>- Support for macros: I tend to agree a bit, but you should look into attributes of .Net to see that there is a whole lot you actually can do to interact with the compiler. Of course this applies to C++.net as well, but now I guess we are leaving the .Net part out of the discussion.</p>
<p>- It is interesting to see that you give a plus to both C# garbage collection as well as the old deterministic destruction of objects. I would like to see why this ambivalence exists. If you use C++ eg. for game-programming, sure - then a lot of your points are true, especially on the det.destruction-point.<br />
But since you are comparing C++  to C# we are not talking about these kind of applications  and therefore there is nothing that promotes your old memory-leaking problems that even the most experienced developer creates in old C++ vs. managed garbage collection.</p>
<p>- Support for globals: What kind of &#8220;global&#8221; are you missing in C#? If you haven&#8217;t grasped the namespace-system then you should study some more. In a true object-oriented model there is need for only one global - the root class. If you don&#8217;t know how to develop without using &#8220;free&#8221; globals, then you should study even further <img src='http://www.thinkingparallel.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>- Supports bitfields: True enough that the language itself doesn&#8217;t support this, but again we are not discussing applications where pure mapping to machine-code is essential (if we were discussing that we wouldn&#8217;t even talk about C#). However, since C# is mainly used in the .Net environment, this is not a problem since .Net offers the same bit-array-handling you have natively in C++ and a lot more manipulation-possibilities that are not there in C++. Thus, no negative.</p>
<p>- STL: You have got to be kidding me or you really have no idea of the extensiveness of the .Net-library. Nuff said on that! Jeez&#8230;</p>
<p>- Portability: This remains the argument in the Java-world, but the the fact is this is not (and has not been for a long time) an issue in corporate reality. The only major shift between platforms done on a global scale the last two decades have been from old Cobol-systems to either (or both) Unix/Linux and Windows.<br />
What an intelligent and cost-effective enterprise today does is to utilize the power of a platform and thus using the environment best suited for this purpose. Neither Java nor C++ classic can do this, just because of the platform-independentness that many of there libraries are built upon. Therefor they are actually far weaker choices as environments.</p>
<p>- any type can be thrown as exception (only classes derived from System.Exception in C#): Not sure what your getting at here so please expand that. You can catch all exceptions in try-blocks, even from unmanaged components, so what is your point?</p>
<p>- ability to enforce const-correctness: Dear old discussion in the C++ community but i tend to agree with Anders Hejlsberg on this subject and do not see this as a major downer.</p>
<p>Well, in conclusion - C++ is naturally the given choice in real-time or close to real-time application-development, but when comparing it to C# we are mainly in the .net-world: In this environment there is in my mind no comparison and C# comes out the winner.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay L. T. Cornwall&#8217;s Personal Site</title>
		<link>http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-23402</link>
		<dc:creator>Jay L. T. Cornwall&#8217;s Personal Site</dc:creator>
		<pubDate>Sun, 16 Sep 2007 11:29:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-23402</guid>
		<description>[...] to suppress those concerns back then but after stumbling across a post on Michael Suess's blog comparing features of C++ with C# I've had second thoughts. On that impulse I've decided to retarget my natural rendering 3D engine [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] to suppress those concerns back then but after stumbling across a post on Michael Suess&#8217;s blog comparing features of C++ with C# I&#8217;ve had second thoughts. On that impulse I&#8217;ve decided to retarget my natural rendering 3D engine [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Suess</title>
		<link>http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-18105</link>
		<dc:creator>Michael Suess</dc:creator>
		<pubDate>Fri, 27 Jul 2007 22:09:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-18105</guid>
		<description>@foo: everything that helps to prevent errors is a pro for me. And using uninitialized objects is an error I see in students code frequently - an error that would be caught by the compiler if they were using C#...</description>
		<content:encoded><![CDATA[<p>@foo: everything that helps to prevent errors is a pro for me. And using uninitialized objects is an error I see in students code frequently - an error that would be caught by the compiler if they were using C#&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: foo</title>
		<link>http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-18102</link>
		<dc:creator>foo</dc:creator>
		<pubDate>Fri, 27 Jul 2007 21:28:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-18102</guid>
		<description>Regarding C#, how is "objects must have a definite value before being used" a pro?</description>
		<content:encoded><![CDATA[<p>Regarding C#, how is &#8220;objects must have a definite value before being used&#8221; a pro?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leo</title>
		<link>http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-8298</link>
		<dc:creator>Leo</dc:creator>
		<pubDate>Sat, 05 May 2007 14:24:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-8298</guid>
		<description>I learnt my .NET from Andrew Troelsen's book on .NET 1.0 - *highly recommended*. Now there is a .NET 2.0 version available (Third Edition) and a .NET 3.0/3.5 scheduled for this year. Large books and can be intimidating at first, but easy to read once you get started. Troelsen covers most of what one needs to write code. Richter's book is a natural follow up. More depth, less surface area.
http://www.amazon.com/Pro-2005-NET-Platform-Third/dp/1590594193/ref=pd_bbs_sr_2/103-4941246-7143836?ie=UTF8&#38;s=books&#38;qid=1178374547&#38;sr=8-2

Regards,
Leo</description>
		<content:encoded><![CDATA[<p>I learnt my .NET from Andrew Troelsen&#8217;s book on .NET 1.0 - *highly recommended*. Now there is a .NET 2.0 version available (Third Edition) and a .NET 3.0/3.5 scheduled for this year. Large books and can be intimidating at first, but easy to read once you get started. Troelsen covers most of what one needs to write code. Richter&#8217;s book is a natural follow up. More depth, less surface area.<br />
<a href="http://www.amazon.com/Pro-2005-NET-Platform-Third/dp/1590594193/ref=pd_bbs_sr_2/103-4941246-7143836?ie=UTF8&amp;s=books&amp;qid=1178374547&amp;sr=8-2" rel="nofollow">http://www.amazon.com/Pro-2005-NET-Platform-Third/dp/1590594193/ref=pd_bbs_sr_2/103-4941246-7143836?ie=UTF8&amp;s=books&amp;qid=1178374547&amp;sr=8-2</a></p>
<p>Regards,<br />
Leo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Ibbotson</title>
		<link>http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-7790</link>
		<dc:creator>Peter Ibbotson</dc:creator>
		<pubDate>Sun, 29 Apr 2007 13:44:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/#comment-7790</guid>
		<description>Another vote for CLR via C# by Jeffery Richter possibly the most used book I have on .net.</description>
		<content:encoded><![CDATA[<p>Another vote for CLR via C# by Jeffery Richter possibly the most used book I have on .net.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
