Managed C++ prospects
Has anyone tried coding in managed C++? I have a few questions :
- How productive is the language compared to C#?
- Is there any restriction on type of projects that can be written? Can we write a web application in managed C++?
- 开发者_运维技巧Is it possible to mix managed and unmanaged C++ code in one application?
- Is MFC still valid in managed C++? Will it be the best option when considering migration of a VC++ application?
I've used managed C++ (C++/CLI) as a bridge between C# and C++. We had a graphical application that used OpenSceneGraph as the 'bottom' layer. Managed C++ was then used in between to grab some of the graphical data as well as interface between the C# and the OSG layers.
It worked pretty darn well in that particular application. However, I would prefer straight C#.
I've found C# to be far more productive. The real magic of managed C++ is that yes, you can mix managed and unmanaged code in it - even inside one function! I don't know how Microsoft did that (and apparently neither do they, because the official name for this feature is "IJW" - "it just works" :)).
I think C# is far better to work with in a managed environment. Managed C++ just seems kind of kludgey to me and I'd much rather work with a language that is meant for a managed environment (not that managed c++ won't work). Furthermore, if you need to, you can call unmanaged code from C# just as you can from managed C++.
精彩评论