PDA

View Full Version : managed extensions



Nor
06-24-2003, 10:59 PM
ok just finished an entry for the solitaire contest. and started reading about managed extensions. as far as i can tell there is not much different.
here is my question to anyone who has used them.

where they any help or hard to use? basicly worth learning. bet porting is a pain.

confuted
06-24-2003, 11:02 PM
the solitaire contest? is there a contest here? *hasn't seen notice of one* What contest?

nvoigt
06-24-2003, 11:45 PM
Managed Extensions ( aka C++.NET ) are a real PITA. You can't avoid them for wrapper DLLs that bring legacy code to the .NET Platform, but other than that, I would really recommend to use C# for managed development. It's way clearer, easier and with almost the same syntax. And as both is managed, there is no recognizable speed gain between C# and C++.NET. If you are out for executable speed at all costs, you don't use managed code anyway, neither C# nor managed extensions.

Edit:

C++.NET has macros, C# has not. In some rare instances it's more usefull to have macros with a language that is hard, than not having them with an easy language. But so far in a project of well over 100 classes, it happened once that I chose macros over ease of use.

Nor
06-25-2003, 08:58 PM
Originally posted by blackrat364
the solitaire contest? is there a contest here? *hasn't seen notice of one* What contest?

http://contests.cprogramming.com/

legacy code? no clue

as far as c#... i know thothing about it.
/*TODO run spellcheck */ //in every cpp file i write

nvoigt
06-25-2003, 11:39 PM
where they any help or hard to use?
basicly worth learning ?
bet porting is a pain.


They are hard to use, but if you have legacy code ( old plain C/C++ code ) that needs to be called from another .NET language, it's way easier to write a managed C++ wrapper for that code and let all other .NET assemblies call that. So only one instance has to convert managed to unmanaged and types into similar types in .NET.
Worth learning if you need to do the above, not worth learning if C# can solve your problem ( i.e. you want to code .NET apps or games ).
I would never port anything from plain C/C++ with MFC or another windows library to managed extensions. If you need .NET, rewrite it in C#. This will save a lot of time now, another lot later and you won't be frustrated by C++.NET :)