473,769 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is There Any Reason to Even Use VC++ Anymore?

Except for legacy or non-.NET applications, is there any reason to use VC++
anymore? It seems that for .NET applications, there would be no reason to
choose C++ over C# since C# is faster to develop with (i.e. no header files,
objects are easier to create and use, C# language is native to .NET)

I'm sure this question will stir some emotions :-)

--
Greg McPherran
www.McPherran.com
Nov 29 '05 #1
37 2158
Ted
Here's some arguments pro-con:

http://blogs.msdn.com/texblog/archiv...21/495404.aspx

Ted.

"Greg" <gm@mcpherran.c om> wrote in message
news:B6******** *************** ***********@mic rosoft.com...
Except for legacy or non-.NET applications, is there any reason to use
VC++
anymore? It seems that for .NET applications, there would be no reason to
choose C++ over C# since C# is faster to develop with (i.e. no header
files,
objects are easier to create and use, C# language is native to .NET)

I'm sure this question will stir some emotions :-)

--
Greg McPherran
www.McPherran.com

Nov 29 '05 #2
See my article :

[A rational attempt to substantiate C++/CLI as a first class CLI language]
URL http://www.codeproject.com/managedcpp/whycppcli.asp

--
Regards,
Nish [VC++ MVP]
"Greg" <gm@mcpherran.c om> wrote in message
news:B6******** *************** ***********@mic rosoft.com...
Except for legacy or non-.NET applications, is there any reason to use
VC++
anymore? It seems that for .NET applications, there would be no reason to
choose C++ over C# since C# is faster to develop with (i.e. no header
files,
objects are easier to create and use, C# language is native to .NET)

I'm sure this question will stir some emotions :-)

--
Greg McPherran
www.McPherran.com

Nov 29 '05 #3
Thank you both for your responses.

Here's my assessment:

For RAD GUI-intensive front ends that may also be published to web: C#

For Windows-only GUI-intensive apps:
C# unless delivery size is critical (e.g. download) and you don't want to
require cutomer to have .NET then C++ and native only.

For Windows-only apps where the GUI is not the major piece:
If performance and/or delivery size is critical then C++ native. Only use
..NET if it has critical features that are not available in MFC/ATL etc.
We have a spectrum:

-------------------------------------
Web
-------------------------------------
Windows GUI/DB apps
-------------------------------------
Windows number crunch apps
Windows direct graphics games
-------------------------------------
Fast ATL browser objects
-------------------------------------
Driver
-------------------------------------

Each area of the spectrum has languages/technologies that map to it. The
problem is that there are grey areas in between :-) C# is generally advisable
for web and GUI intensive Windows-only apps. C++ native is still generally
advisable for many Windows-only apps. I don't think that just because we have
..NET that MFC and ATL are antiquated. Each has its own place.

C# may begin to drill drown to areas now covered by C++ and C++ may begin to
"drill up" to the web and .NET (as it already has in VS 2005).

I think a smart way to manage all this is to isolate the GUI front end from
your core app crunching in your architecture. This way, the .NET vs native
decision can be made independently for these architectural areas. For
example, one could evolve an app's GUI to .NET and leave the app crunching in
native. Or the same app may even take two forms (no pun intended :-) ) one
with a .NET front end and one with an MFC front end. Both could be supported
with a proper architecture and each flavor could have it's own advantages.
We're not in Kansas anymore Toto :-) Pick your tool for what you're trying
to accomplish and what will get you there fastest. It's not either-or, it's
all of the above :-)

--
Greg McPherran
www.McPherran.com

Nov 30 '05 #4
Greg wrote:
Except for legacy or non-.NET applications, is there any reason to use VC++
anymore? It seems that for .NET applications, there would be no reason to
choose C++ over C# since C# is faster to develop with (i.e. no header files,
objects are easier to create and use, C# language is native to .NET)


From this, it sounds like you haven't hear of C++/CLI, which is new in
the recently released VC2005.

C++/CLI is also native to .NET, doesn't need header files, and is
(arguably) faster to develop with than C# due to being more fully
featured while still supporting all the convenience of garbage
collection, etc. C++/CLI also produces faster code due to having a
compile-time optimizer (it can generate optimized byte code).

Tom
Nov 30 '05 #5
Tom Widmer [VC++ MVP] wrote:
Greg wrote:
Except for legacy or non-.NET applications, is there any reason to use
VC++ anymore? It seems that for .NET applications, there would be no
reason to choose C++ over C# since C# is faster to develop with (i.e.
no header files, objects are easier to create and use, C# language is
native to .NET)

From this, it sounds like you haven't hear of C++/CLI, which is new in
the recently released VC2005.

C++/CLI is also native to .NET, doesn't need header files, and is
(arguably) faster to develop with than C# due to being more fully
featured while still supporting all the convenience of garbage
collection, etc. C++/CLI also produces faster code due to having a
compile-time optimizer (it can generate optimized byte code).

Tom


Tom:

Even so, I am concerned about the future of C++ at Microsoft.

If you already know C++ well, the much improved C++/CLI is a natural
choice. But if you do not, then C# must look awful tempting. The
learning curve for C++ was always steep, and CLI certainly has not made
it any easier.

C++/CLI advantages:

1. Deterministic destruction. Nice, but can be done in C# using Dispose
(and maybe C# will get it right one day).

2. Interoperabilit y with native code. Nice, but can also be done less
conveniently from C#. And this feature has a downside - non-verifiable code.

3. Improved optimization. Nice, but not a deal-breaker for most
applications.

4. STL.NET (if we ever see it). This could be a biggie if you want to
write verifiable code, and could constitute the only real advantage over
C# in this situation. But the learning curve of STL is extremely steep,
and many appliactions really do not need it.

5. Traditional C++ portability to other platforms. It remains to be seen
how portable it will remain in the presence of CLI extensions.

C# advantage(s):

A much simpler language, without historical baggage, designed
specifically for the CLR.

I guess I fear that the main function of C++/CLI will be to entice
existing C++ programmers into .NET. When we are all dead, perhaps few
people will be learning it any more. VB.NET, anyone?

David Wilkinson
Nov 30 '05 #6
David Wilkinson wrote:
Tom Widmer [VC++ MVP] wrote:
Greg wrote:
Except for legacy or non-.NET applications, is there any reason to
use VC++ anymore? It seems that for .NET applications, there would
be no reason to choose C++ over C# since C# is faster to develop
with (i.e. no header files, objects are easier to create and use, C#
language
is native to .NET)

From this, it sounds like you haven't hear of C++/CLI, which is new
in the recently released VC2005.

C++/CLI is also native to .NET, doesn't need header files, and is
(arguably) faster to develop with than C# due to being more fully
featured while still supporting all the convenience of garbage
collection, etc. C++/CLI also produces faster code due to having a
compile-time optimizer (it can generate optimized byte code).

Tom


Tom:

Even so, I am concerned about the future of C++ at Microsoft.


Just ask yourself one question : In what language do you think
1) Windows
2 The .NET CLR
are written, and how are they compiled?
If you already know C++ well, the much improved C++/CLI is a natural
choice. But if you do not, then C# must look awful tempting. The
learning curve for C++ was always steep, and CLI certainly has not
made it any easier.

C++/CLI advantages:

1. Deterministic destruction. Nice, but can be done in C# using
Dispose (and maybe C# will get it right one day). The Dispose pattern is far inferior to RAII because resource freeing is on
the responsibility of the client code.

2. Interoperabilit y with native code. Nice, but can also be done less
conveniently from C#. And this feature has a downside -
non-verifiable code. C++ Interop is also much faster and efficient that COM Interop or P/Invoke.
Non-verifiable code is only a matter in low-trusts scenarios : in practice
when writting web code or plugins for some "hosting" apps such as SQL Server
2005.
C# advantage(s):

A much simpler language, without historical baggage, designed
specifically for the CLR.


Agreed, C# is much easier and simplier, but it also lacks some features of
C++ : templates come to mind first (and generics are no replacement for
templates because templates are a Turing-complete language, generics are
not).

Arnaud
MVP - VC
Nov 30 '05 #7
The main reason to use C++ is that it's still the language you know (even
with the new 2005 syntax). Also, objects are not easier to create in C# and
there are 4 core Microsoft .NET languages: C++, C#, VB, and J#. C# has no
special place in the .NET world - it just happens to be the newest one.

C++ has many language features not available in any other .NET languages.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter

"Greg" wrote:
Except for legacy or non-.NET applications, is there any reason to use VC++
anymore? It seems that for .NET applications, there would be no reason to
choose C++ over C# since C# is faster to develop with (i.e. no header files,
objects are easier to create and use, C# language is native to .NET)

I'm sure this question will stir some emotions :-)

--
Greg McPherran
www.McPherran.com

Nov 30 '05 #8
See inline

Willy.

"Arnaud Debaene" <ad******@clu b-internet.fr> wrote in message
news:OK******** ******@tk2msftn gp13.phx.gbl...
David Wilkinson wrote:
Tom Widmer [VC++ MVP] wrote:
Greg wrote:

2. Interoperabilit y with native code. Nice, but can also be done less
conveniently from C#. And this feature has a downside -
non-verifiable code.

C++ Interop is also much faster and efficient that COM Interop or
P/Invoke.
Non-verifiable code is only a matter in low-trusts scenarios : in practice
when writting web code or plugins for some "hosting" apps such as SQL
Server 2005.

C++ interop is not faster than PInvoke, whenever you cross the managed
unmanaged border you take a hit, be it using C++ interop or PInvoke. And
whenever you need to pass non blitables to or from managed memory, you take
a hit because of the marshaling that has to be done. Only advantage you have
with C++ interop is that you are in charge (control?) of the marshaling, so
you have a chace to optimize, while using PInvoke, the marshaling is
automatically done for you.

C# advantage(s):

A much simpler language, without historical baggage, designed
specifically for the CLR.


Agreed, C# is much easier and simplier, but it also lacks some features of
C++ : templates come to mind first (and generics are no replacement for
templates because templates are a Turing-complete language, generics are
not).

Arnaud
MVP - VC

Dec 1 '05 #9
We have chosen C++\CLI as our current source code base is in C++ and
provides a clear migration path.
Its also a benefit for us to be able to use mixed mode using both the
un-managed and managed heap in the same application/function.
You could almost think of the syntax extensions almost independent of
..NET. Just can now work with a garbage collector etc.

Dec 1 '05 #10

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

Similar topics

2
1109
by: Peter Nolan | last post by:
Hello, Is VC++ 6.0 available to buy anymore? I've just been to www.msdn.microsoft.com and it doesn't look it. Peter Nolan. Dublin.
0
1379
by: Anders Eriksson | last post by:
Hello! I don't get it! How do I use an ActiveX control in VC++ 7.1?? I'm using MFC and I have added the ActiveX control to my ToolBox and then added it to my CFormView. In VC++ 6.0 there was created a Wrapper Class automatically , but not anymore.
4
3747
by: Michael Nemtsev | last post by:
I've seen a lot of times using return value in parentesises - { .... return (true); } What's the reason for this? Can smb explait it? PS: they do return predefined values, not calculated like returd (I*(d/4)) --
7
2139
by: Frederico Pissarra | last post by:
Recently I tried to use -G5 option on CL compiler (from Visual Studio 2005)... To my surprise, there is no processor specific optimizations anymore! Is that correct? Is so, why? s Fred
11
4417
by: Herhor | last post by:
Hello! I have already started C++ programming with VC++ 2005 Express Edition. Unfortunately during debugging one of my first programs I had to unintentionally enable some debugger configuration feature which turns on Disassembly Window at the end of every my program (basic example below). int main() { //some instructions;
27
2770
by: Jason Doucette | last post by:
I'm getting an assertion fire from a list iterator being checked against NULL. This did not occur in VC++ 2003 (v7.1). Are there changes that have been made to the STL between these versions that I should know about? Any resources I should check into? thanks, Jason
1
2202
by: TheFid | last post by:
In case someone knows off the top.... I am accessing a COM-interface-exposing C# dll in VC++ 6. The C# disp method can throw a COMException. Do I catch a _com_error ? It's not obvious from the docs. TIA, Mike
0
9586
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10210
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9990
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8869
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.