943,648 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 4880
  • C# RSS
Jan 26th, 2009
0

Advantages of C# over C++

Expand Post »
Hi, what are the advantages of C# over C++? I have a little bit of knowledge in both of them, but I am going to choose which one to dedicate most of my time to.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
gsingh2011 is offline Offline
70 posts
since Dec 2008
Jan 26th, 2009
2

Re: Advantages of C# over C++

Garbage collection is the most important, and outweighs the combination of all other advantages.

C# has anonymous functions, i.e. closures, which outweighs the combination of all the advantages below.

C# has an actual module system.

C# has generics, which are more powerful in some ways than C++'s compile-time template system, and less powerful in others -- I would describe them as a little bit less verbose.

C# has extension methods which are cute but only a minor advantage.

You get a little bit more certainty about the various primitive data types -- you know that an int is an Int32.

Did I mention garbage collection?

Unless you're doing low-level numerical computation where processor time is the limiting factor, or unless you're using a lot of C++ libraries, C# is preferable.

Another advantage of C# is that you can use better languages that run on .NET too, like F#, and other languages, like Boo.
Last edited by Rashakil Fol; Jan 26th, 2009 at 11:38 pm.
Team Colleague
Reputation Points: 1133
Solved Threads: 171
Super Senior Demiposter
Rashakil Fol is offline Offline
2,478 posts
since Jun 2005
Jan 27th, 2009
0

Re: Advantages of C# over C++

c# is great but, it truly depends what you're going to code as to what you would probably best learning whats right for us isnt necessarily right for you
Reputation Points: 196
Solved Threads: 190
Posting Virtuoso
LizR is offline Offline
1,735 posts
since Aug 2008
Jan 27th, 2009
0

Re: Advantages of C# over C++

I used both. It's two different languages for two different purposes. For normal app company system, I just use C#. For something require extra power ex graphic editor or game, sometime I use C++.
Reputation Points: 11
Solved Threads: 4
Light Poster
hieuuk is offline Offline
44 posts
since Nov 2008
Jan 27th, 2009
0

Re: Advantages of C# over C++

For business applications (Database as backend) C# is better
For learning and teaching students what the programming is; C++ is better.
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006
Jan 27th, 2009
0

Re: Advantages of C# over C++

Besides what has been said. C# is more strict that C++.
e.g.: in C# you MUST have a boolean or expression that evaluates to a boolean after an if or while statement, in C++ you can also use integers like 0 or 1 for that.
Reputation Points: 2023
Solved Threads: 644
Senior Poster
ddanbe is online now Online
3,736 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: redrawing panel
Next Thread in C# Forum Timeline: What version of C# do you work with?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC