VC++ vs C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can any one give me a couple of good reasons (advantages) to use VC++ 2005
versus using VC# 2005 (especially for a middle tier component development)?

rachete.
 
Rachete said:
Can any one give me a couple of good reasons (advantages) to use VC++ 2005
versus using VC# 2005 (especially for a middle tier component development)?

rachete.

Are you committed to the .NET Framework? You are with C#. With C++ you have
a lot more platform flexibility.
For the record: this is *not* an anti .NET comment. Just an observation on a
difference between C# and C++.
 
VC++ 2005 allows you to write pure managed apps, unmanaged apps or
mixed-mode apps (managed/unmanaged).

C# only allows you to write pure managed apps. [so it's not much value for
money]

Go with C++ :-)
 
Rachete said:
Can any one give me a couple of good reasons (advantages) to use VC++ 2005
versus using VC# 2005 (especially for a middle tier component
development)?

rachete.

C++ has lots of flexibility and power, but as a consequence takes longer to
master. As Nishant says, it has the ability to mix .NET (managed code) with
native (or unmanaged) C++ in the same project, though of course, this is
only useful if you have a lot of native C++ code you're planning to use.

Personally I've found coding C# a more pleasant experience in VS2003 than
Managed C++ (though the majority of my professional work is C++ - maybe
that's soured me against it :-) ).

If you're planning to go multi-platform, C# is a bad choice (you could look
at Java). If this isn't the case, and your code will be pure .NET, I don't
see any reason to go with C++.

Steve
 
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
 
Russell said:
Here are a few of my experiences.

[snipped excellent comparision of features for VS.NET 2003]

The only thing I'd add to this is that the equation changes a great deal
with VC++ 2005. With the new C++/CLI syntax all of those easier-in-c#
things are just as clean in C++, AND you still have all the power of the
full C++ language.

If you're just getting started on something that you don't expect to ship
until 3Q next year, you might seriously want to try out the VC++ 2005 beta.

-cd
 
I have just discovered that VC++ VC2005, will support #region / #endregion
like C# does:
The feature currrent appears in the current VC++ Beta.

I discovered this information in another post in this newsgroup 12/18/2004
from Tomas Restrepo:

#pragma region and #pragma endregion are already supported by the VS2005 ide
(at least in beta1) and they do not generate unrecognized pragma warnings by
the compiler.
 
Russell said:
I have just discovered that VC++ VC2005, will support #region /
#endregion like C# does:
The feature currrent appears in the current VC++ Beta.

I discovered this information in another post in this newsgroup
12/18/2004 from Tomas Restrepo:

#pragma region and #pragma endregion are already supported by the
VS2005 ide (at least in beta1) and they do not generate unrecognized
pragma warnings by the compiler.

The 2003 compiler recognizes (and silently ignores) the #pragma as well, but
the 2003 IDE doesn't have any support for it.

-cd
 
Back
Top