What are the advantages of managed C++?

  • Thread starter Thread starter Scirious
  • Start date Start date
S

Scirious

People, does the managed version of C++ in VS.NET offer the same facilities
the C# version offer like garbage collection and mamorry management??

Thanks,
Scirious.
 
Scirious said:
People, does the managed version of C++ in VS.NET offer the same
facilities
the C# version offer like garbage collection and mamorry management??

That depends. Instances of managed classes are garbage collected. Instances
of native classes are not.

IMO, it is the fact that you can mix metaphors that makes the language
attractive in interop scenarios.

Regards,
Will
 
Scirious said:
Ok, but what would make me chose to learn C++ instead
of C# to use with .Net?

I didn't say that there would be something. :-)

If C++ is your preferred language, you may want to continue using it to
target the .Net platform. If you are not familiar with either language AND
you wish to target .Net you might was well go with C#. Just my opinion,
YMMV.

Regards,
Will
 
Scirious said:
Ok, but what would make me chose to learn C++ instead of C# to use with
..Net?

Disclaimer: I've never used C#.

I can think of at least 2 reasons why a developer might prefer C++ over C#:

1. The developer already has experience with C++. Other developers have told
me that C++ and C# are just different enough from each other to drive an
experienced C++ developer batty over the syntax differences. Especially now
that we have C++/CLI instead of those @#$%! Managed Extensions for C++,
continuing with C++ is the path many C++ developers, including myself, have
chosen.

2. The developer needs to be able to interact well between managed and
unmanaged code. C++ can do various interop things that C# can't, starting
with the ability to mix managed and unmanaged code in a single executable.

If you don't fall under either of these categories, I've been led to believe
that C# is somewhat easier to learn than C++ if you don't know either
language.

Sean
 
Back
Top