Here are a few of my experiences.
Look at what your application needs to do, if the application needs
access/use to lots of un-managed code, then C++ is definately a winner. If
the application is just accessing an SQL server and can get it's job done
using managed classes (Base Class Libary), then you have a tougher choice
between the two languages.
Assuming that your application can get is job done with mananged code
consider the following, I am listing them what I consider the most important
order.
The C# project itself is very simple compared to C++ projects, as they can
be very difficult to deal with if you are not a seasoned C++ developer. It's
the .h files or header files that will drive you nuts.
C# code is exceptionally, "Clean", it looks really good after you write it,
C++ code is just plain "Gnarly", especially when you are using managed
extensions. Don't get me wrong here, I love what C++ code looks like, when
you are not using managed extenstions. Example: A simple WinAPI method
written in un-mananged code looks attractive when you are finished writing
it.
C# has several things that allow you to write less code. Here are a few,
listed in order:
1. The C# #region and #endregion feature is simply an awesome IDE feature
for collapsing code you do not wish to look at, C++.NET does not have it. In
fact, if there was one thing that I could get in C++ it would definately be
#region and #endregion. It's simply a brilliant feature. This thing will
save you countless hours of development.
2. The C# Using statement is awesome, because it reduces the number of lines
of code you need to write. Note this is not the same "Using" that you see at
the top of your source code.
3. The properties in C# are much cleaner looking, as they don't show all the
private variables, and backing methods, when you actually use them. C++ just
shows them all to you.
4. Accessing collection classes, from C# is simpler.
5. String concatenation is much cleaner in C#, C++ requires method calls for
most.
6. Hey, C# is a brand new language, and does not have to deal with the past,
it should be simpler.
Bottom line is this, all languages are tools, and the more tools you have in
your toolbox, the more powerful you are as a developer. C++ will never,
ever, go away, as C# is nothing without the Windows API, and all Windows
API's are written in C/C++. In fact, most of the bcl is just calling
un-managed WinAPI code.
C#, C++.Net, VB.net, were designed to help you get more work done, use em
all!
Russell Mangel
Las Vegas, NV