Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > What is Place of Managed C++ in .NET?

Reply
Thread Tools

What is Place of Managed C++ in .NET?

 
 
=?Utf-8?B?QWxwZXIgQUtDQVlPWg==?=
Guest
Posts: n/a
 
      04-04-2005
Hello Esteemed Developers and Experts,

I have been using Microsoft Visual C++ .NET for 1 year. During this time,
I have searhed some topics over internets. Most of the topics about .NET is
related to C# and Visual Basic .NET. There are less documents about Visual
C++ .NET or Managed C++.

I wonder the reasons of below questions:
1) Is C# more powerful than Managed C++ and Visual C++ .NET?
2) Is Microsoft intending to support C# and V.B. .NET more than Managed
C++?
3) Can C# take the place of standard C++ in terms of performance?
4) What kind of advantages C# have compare to Managed C++ and Visual C++
..NET?

I thank your kind responses and guidances in advance.

Best Regards
--
~~~~~~~~~~~~~~~~~~~
İyi Çalışmalar
Alper AKÇAYÖZ (Bil Muh)

Wish You Good Work
Alper AKCAYOZ (Bil Muh)
 
Reply With Quote
 
 
 
 
Olaf Baeyens
Guest
Posts: n/a
 
      04-04-2005
> I have been using Microsoft Visual C++ .NET for 1 year. During this time,
> I have searhed some topics over internets. Most of the topics about .NET

is
> related to C# and Visual Basic .NET. There are less documents about Visual
> C++ .NET or Managed C++.
>
> I wonder the reasons of below questions:
> 1) Is C# more powerful than Managed C++ and Visual C++ .NET?
>

No. C# us not more powerfull than C++.
But C# is far easier to create .NET programs than unmanaged C++. Far more
readable and much faster to compile.
C# appears to be designed from the scracth up to be pure .NET programs. C++
still have a need for this backward compatibility issuses, so the language
gets complicated with all these addtion macro's and keywords....

The nice things about the .NET is that all code in VB, C# and managed C++
looks the same except for syntax.

Another reason is maybe that C++ programmers tend to like very optimized
code, even if it takes an few months to create while a C# programmer needs a
day or so to create something like that. So I believe that a lot of C++
programmers don't like the .NET way of programming because they lose their
years of experience and have to relearn everything from scratch becoming a
newbie.
Another reason could be that a lot of C++ programmers get in their 40's and
have a hard time to keep up with the new technology.

Then again, a C++ programmers, like me that don't mind to get scared away of
becoming a newbie again also exist and they are very fond of .NET

> 2) Is Microsoft intending to support C# and V.B. .NET more than

Managed
> C++?
>

I don't think so, C++ is still very important because of the huge code base.
C++ is still ery important for the next 10 years, so is the MFC.

> 3) Can C# take the place of standard C++ in terms of performance?
>

Not at this moment but it gets pretty close according to my tests.

I discovered that you lose speed in some places, but gain speed in other
places. Especially the .NET framework contains very high optimized code. In
my code I have the feeling that I lose about 5% speed on average compared to
a pure C++ program, but I did make the C# version 7 times faster.

Tests suggests that the .NET match library is actually faster than the
unmanaged C++ library.
Maybe they redesigned the .NET match library for even better performance
gain, while the older C++ library has not been updated.

> 4) What kind of advantages C# have compare to Managed C++ and Visual

C++
> .NET?
>

See the topic "In need of .NET advocacy" in this news group. Everything you
ever want to know is discussed there.


--
http://www.skyscan.be


 
Reply With Quote
 
 
 
 
=?Utf-8?B?QWxwZXIgQUtDQVlPWg==?=
Guest
Posts: n/a
 
      04-04-2005
Thank you very much for your response.
Many of the systems that require performance -like image processing, voice
recognition, military software- are developed in C++. In the course of the
time, can C# find a considerable a good place in these areas?
Within the projects that are in C#, using the C++ codes is possible.
Therefore, can C# be used in Performance-Required areas?


"Olaf Baeyens" wrote:

 
Reply With Quote
 
Olaf Baeyens
Guest
Posts: n/a
 
      04-04-2005
> Thank you very much for your response.
> Many of the systems that require performance -like image processing, voice
> recognition, military software- are developed in C++. In the course of the
> time, can C# find a considerable a good place in these areas?
> Within the projects that are in C#, using the C++ codes is possible.
> Therefore, can C# be used in Performance-Required areas?
>

I create imaging software, and I try to create the user interface part and
the stuff that is less performance critical in C# because I can create that
part much faster.

But a huge part of my code base is unmanaged C++ using MFC. And I simply do
not have the time to port it to C# or managed C++ at this moment, so I have
created a mixed C++ assembly that has both managed as unmanaged code acting
as wrappers.

The nice thing about .NET is that I can create components in C#, managed
C++, VB.NET... and freely mix them with each other without any problems.
Just make sure that you avoid case sensitivity in de class naming to make
sure that it can still be used in VB.NET. But you have a program that checks
compatibility called FxCop that analyzes your code assembly and explains
what you might to change things in a very friendly manner.

Now the problem is that you either create a C# assembly or a C++ managed
assembly. You cannot compile C++ code in a C# project. So you end up with
multiple assemblies (dll's), which at first sounds scary for the
installation procedure, but a .NET program is best installed using a setup
so that does not pose any problem. The setup can automatically configure the
computer for enough user rights to run that program across a network and
so... So no more complicated installation and user righst.

One thing I had problems with in the beginning was this MFC thing. I
discovered that I need to compile with MFC in a DLL, and this gave me
problems because I used the assemblies in a subfolder which is a nice system
to avoid dll clashes if one assembly needs v1.2 of a dll and the other
assemblie used in your same program uses that same assebly name but with a
different vesrion v1.1. I discoverd that the subfolder thing was perfect for
none-MFC dll's. The MFC dll's should reside in the same folder of your dll
and executable.

You will lose some speed if you move from managd to unmanaged code and back.
So it is best to concentrate the code into managed or managed code, but try
to avoid the transition as much as possible. But it works greate.

I faced one small problem. one of the projects I created is a dll plugin for
a conventional exe program. The dll is a mixed manged/unmanaged dll that
have the user interface as a managed part. But it turned out that the .NET
framework did not find the correct assemblies even though they were located
in the same folder of the main dll. The reason was because the executable
was located in another folder, the plugin in yet another folder. The .NET
framework tried to locate the dll's in the .EXE folder instead of the plugin
..DLL folder. Since creating a setup is not desired that installs plug-ins in
the program folder of the exe, suppose you have 2 plugins with the same
name? I found a sollution in installing the assemblies into the GAC. I don't
like that but it is the best solution so far I have come up with that is
reliable. Setting the current directory didn't solve the problem.

So I hope that you have now an overview of what is possible.

--
http://www.skyscan.be


 
Reply With Quote
 
Ioannis Vranos
Guest
Posts: n/a
 
      04-04-2005
Alper AKCAYOZ wrote:

> Hello Esteemed Developers and Experts,
>
> I have been using Microsoft Visual C++ .NET for 1 year. During this time,
> I have searhed some topics over internets. Most of the topics about .NET is
> related to C# and Visual Basic .NET. There are less documents about Visual
> C++ .NET or Managed C++.
>
> I wonder the reasons of below questions:
> 1) Is C# more powerful than Managed C++ and Visual C++ .NET?



No, the opposite is true. With the advent of VC++ 2005, C++ becomes the systems
programming language of .NET. Some references:


You may take a look at these:

http://msdn.microsoft.com/msdnmag/is...s/default.aspx

http://pluralsight.com/blogs/hsutter...0/05/2672.aspx

http://blogs.msdn.com/branbray/archi.../07/51007.aspx

http://www.accu.org/conference/prese...keynote%29.pdf


And a page of mine:

http://www23.brinkster.com/noicys/cppcli.htm



> 2) Is Microsoft intending to support C# and V.B. .NET more than Managed
> C++?



No.


> 3) Can C# take the place of standard C++ in terms of performance?



No!


> 4) What kind of advantages C# have compare to Managed C++ and Visual C++
> .NET?



By providing less facilities, it makes it easier to learn doing simple applications but of
course it has fewer capabilities.
 
Reply With Quote
 
=?Utf-8?B?QWxwZXIgQUtDQVlPWg==?=
Guest
Posts: n/a
 
      04-04-2005
Thank you Baeyens. Your expriences and explanations are important for me.
These comparisons helped me to visualize the logic in my mind.
I thank you again for sharing your time with me.
Best Regards.

"Olaf Baeyens" wrote:

 
Reply With Quote
 
=?Utf-8?B?QWxwZXIgQUtDQVlPWg==?=
Guest
Posts: n/a
 
      04-04-2005
Hello Vranos,
I would like to advance much further on a programming language. Therefore, I
wonder the differences of prog. lang. in .NET.
With your explanations, can we say that C++ will keep its popularity,
performance and its other advantages for a long time both in .NET technology
and other Performance-Required fields?

My aim is to work on Performance-Required software. Therefore, is it
possible to say that Visual C++ .NET/Managed C++ is the correct choice?


"Ioannis Vranos" wrote:

 
Reply With Quote
 
Severian [MVP]
Guest
Posts: n/a
 
      04-04-2005
On Mon, 4 Apr 2005 06:39:04 -0700, "Alper AKCAYOZ"
<(E-Mail Removed)_SiLiNiZ_REMOVE> wrote:

>Hello Vranos,
>I would like to advance much further on a programming language. Therefore, I
>wonder the differences of prog. lang. in .NET.
>With your explanations, can we say that C++ will keep its popularity,
>performance and its other advantages for a long time both in .NET technology
>and other Performance-Required fields?
>
>My aim is to work on Performance-Required software. Therefore, is it
>possible to say that Visual C++ .NET/Managed C++ is the correct choice?


Unmanaged code will usually provide better performance for
time-critical things such as image and signal processing; should you
commit yourself to .NET, you'll probably use both managed and
unmanaged C++.

If standard or portable C++ knowledge is important to you, use
unmanaged C++.

--
Phillip Crews aka Severian
Microsoft MVP, Windows SDK
Posting email address is real
 
Reply With Quote
 
Olaf Baeyens
Guest
Posts: n/a
 
      04-04-2005
> My aim is to work on Performance-Required software. Therefore, is it
> possible to say that Visual C++ .NET/Managed C++ is the correct choice?
>

In my opinion, yes.
User interface = managed C++
Performant code = unmanaged C++

Look for the specifications of the new Visual Studio 2005 which includes
C++ and C# standard, it has interesting features.
First of all, it compiles you code (loops) in certain conditions to execute
it as hypethreading even though you do not program with threading. And it
has a featur to analyze the most used functionality by profiling and then it
can optimize even furter depending on the most used functions.

And you can freely mix managed/unmanaged within the same methods.
But much less readable than C#.

--
http://www.skyscan.be


 
Reply With Quote
 
Jon Gabel
Guest
Posts: n/a
 
      04-04-2005
Will VS 2005 Managed C++ be usable for applications targeting the .NET
Compact Framework?

Jon Gabel

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inexpensive access points that can be centrally managed SpiritBoy Wireless Networking 0 03-31-2005 03:27 PM
AWLP turns your PC into web-managed wireless access gateway Alp Wireless Networking 0 01-04-2005 10:47 AM
Memory Allication (Managed VC++ DLL to Unmanaged DLL) [Second Try] Weston Fryatt ASP .Net 2 01-01-2005 11:31 AM
HELP !!! Managed C++, WinForms and ATL !!! Dmitry ASP .Net 0 11-01-2004 07:27 PM
Managed Code??? Manoj Mohan ASP .Net 4 09-25-2003 09:36 AM



Advertisments