473,394 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

VC++ vs C#

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.
Nov 17 '05 #1
7 1589

"Rachete" <Ra*****@discussions.microsoft.com> wrote in message
news:22**********************************@microsof t.com...
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++.

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Nov 17 '05 #2
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++ :-)

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com /* MVP tips tricks and essays web site */
http://blog.voidnish.com /* My blog on C++/CLI, MFC, Whidbey, CLR... */
"Rachete" <Ra*****@discussions.microsoft.com> wrote in message
news:22**********************************@microsof t.com...
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.

Nov 17 '05 #3
"Rachete" <Ra*****@discussions.microsoft.com> wrote in message
news:22**********************************@microsof t.com...
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
Nov 17 '05 #4
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



Nov 17 '05 #5
Russell Mangel wrote:
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
Nov 17 '05 #6
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.

--
Tomas Restrepo
to****@mvps.org
"Rachete" <Ra*****@discussions.microsoft.com> wrote in message
news:22**********************************@microsof t.com...
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.

Nov 17 '05 #7
Russell Mangel wrote:
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
Nov 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Tatu Portin | last post by:
Have this kind of struct: typedef struct { char **user_comments; /* ... */ } vorbis_comment; /* prototype */ char * read_vorbis_string ( FILE *sc);
4
by: Anthony Gallagher | last post by:
I have a bunch of libraries compiled using VC++ 6.0, and I am trying to recompile one of our projects using VC++ .NET. I get all kind of linker errors (specially in STL calls). How do I get rid of...
5
by: Hari | last post by:
Guys please help me to solve this strange problem what Iam getting as follows.. Trying to instantiate a global instance of a template class as follows :- when i build this code with debug and...
2
by: vemulakiran | last post by:
Hi all, I have doubt regarding .NET. I have a tool which was developed on VC++ 6.0(Win32 Application ). The application communicates with library (API) which was developed on VC++ 6.0 called core...
2
by: | last post by:
Everything seems to be moving to .NET and VC++ seems to be adding a lot of managed code support every new release. The questions: is unmanaged code in VC++ beeing phased out in favour of managed...
4
by: ultranet | last post by:
I have cruised around http://msdn.microsoft.com/visualc/ and the rest of the site, and i am not able to find a single C++ or VC++ certification exam that will be available after June 30, 2004. I...
1
by: Steve | last post by:
We are considering the ways to migrate our VC++ 6.0 applications to .NET platform. It would be nice to rewrite them completely in C#, but due to the time constraints this option is out of...
2
by: um | last post by:
When the POSIX pthreads library for w32 release 2-2-0 (http://sources.redhat.com/pthreads-win32/) is compiled with VC++6 then it compiles and passes all the benchmark tests in the subdirectory...
15
by: Michael Tissington | last post by:
I have a Visual Basic 6.0 ActiveX Control. It seems there is no way with VS 2005 to create a similar control for containers that host ActiverX controls, is this correct ? I'm thinking of...
7
by: Norman Diamond | last post by:
A project depends on VC runtime from Visual Studio 2005 SP1, and DotNet Framework 2. Options are set in the setup project properties, so if these two dependencies are not already installed then...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.