need more info on managed c++

Started by
6 comments, last by alnite 21 years ago
I have looked on some Managed C++ tutorials, and they show how to make buttons and stuff in Managed C++. It looks clean, and a whole lot better than API and MFC. So I consider learning it some time in the future. Does any of you have more info about managed C++, like speed difference vs C++ (since it's a .NET language, I assume it's pretty much the same with VB and C#), DirectX OpenGL support, some more tutorials, STL support, and stuff? Current project: A puzzle game.
% completed: ~0%
Status: Active.
[edited by - alnite on April 21, 2003 4:18:07 AM]
Advertisement
Managed C++ will compile any non-managed code because any code not declared as managed will ignore .NET stuff.

-- Exitus Acta Probat --
Managed C++ uses the .NET framework, not the STL. All .NET languages are almost equal in terms of speed, so yes C# and VB.NET are just as fast as Managed C++. As for speed vs. pure C++ I have no idea. But when you're writing applications (which is what you'd compare, .NET vs. MFC) a mere 2-5% speed difference is not even noticed. I'm not exactly sure if I'd use Managed C++ for game programming, but it's certainly more then capable of doing so. As for DirectX and OpenGL, .NET supports the DirectX 9.0 SDK.

To be honest, I don't really care for Managed C++. If you're going to learn .NET, you might as well learn a language that was built from the ground up to use it, and that's C#. If you think Managed C++ looks clean, then you should take a look at C#. C# is also a bit of a mix between C++ and Java, so you probably wouldn't have any troubles picking up the language. The only huge learning curve with .NET is learning the .NET framework itself, everything else is easy.

You can find more info on .NET (and all languages that use it) here:
http://www.gotdotnet.com/

[edited by - wyrd on April 21, 2003 11:47:46 AM]
quote:Original post by wyrd
Managed C++ uses the .NET framework, not the STL.
But there is a possibility of using STL in Managed C++, right? All articles that I have read pointed out that you can mix Managed C++ and Unmanaged C++.
quote:To be honest, I don''t really care for Managed C++. If you''re going to learn .NET, you might as well learn a language that was built from the ground up to use it, and that''s C#.
Why is C# the only language that was built from the ground up to use .NET?
quote:If you think Managed C++ looks clean, then you should take a look at C#. C# is also a bit of a mix between C++ and Java
Yes, I have looked at C# codes (generated by AppWizard), and still, compared to these code I found, I still think Managed C++ is cleaner, although there aren''t much differences between them. But the mixing of Managed and Unmanaged is something that I look for.

Current project: A puzzle game.
% completed: ~0%
Status: Active.
quote:Original post by alnite
But there is a possibility of using STL in Managed C++, right?

You can use whatever you want in Managed C++ - including the STL. The only limitation is on the classes that you want to expose to other managed languages. These have to conform to a set of rules that apply to managed classes.
quote:
Why is C# the only language that was built from the ground up to use .NET?

C#''s feature set maps almost 1-1 onto the feature set of MSIL. C# and MSIL was designed for eachother - MC++ had features tagged onto it to make it work in a managed environment.
quote: Yes, I have looked at C# codes (generated by AppWizard), and still, compared to these code I found, I still think Managed C++ is cleaner, although there aren''t much differences between them.

I am currently involved in a project which requires both MC++(for interop) and C#. I have found that if I have a choice between implementing a feature in C# or C++, I go with C# every time. The syntax and the language is just so much cleaner. C# projects also builds orders of magnitude faster than an equivalent MC++ project.
There are also some features C# has that aren''t supported in MC++ - one of them being explicit interface implementation(and MC++ doesn''t allow covariance in managed classes either). The lack of this makes it harder to utilize the CollectionBase and DictionaryBase classes to create your own strongly typed collections(this was a real issue for us).
quote:
But the mixing of Managed and Unmanaged is something that I look for.

Indeed, and this is where MC++ shines. I don''t think I would even consider using MC++ for a standalone project, but as a tool for interoperating with an existing unmanaged codebase, it is indispensable.


"Laughter means distance. Where laughter is absent, madness begins. The moment one takes the world with complete seriousness one is potentially insane. The whole art of learning to live means holding fast to laughter; without laughter the world is a torture chamber, a dark place where dark things will happen to us, a horror show filled with bloody deeds of violence."
-- Jens Bjørneboe
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
Thanks for the replies. One more question before I decide to learn Managed C++. Is it practical to write algorithms where speed matters in Unmanaged C++, and then write its Managed C++ wrapper class? I am confused with the speed here since everything is linked in compile time (through projects), not runtime.

Current project: A puzzle game.
% completed: ~0%
Status: Active.
quote:
But there is a possibility of using STL in Managed C++, right? All articles that I have read pointed out that you can mix Managed C++ and Unmanaged C++.


Er.. ya. I didn''t phrase that very well. Arild Fines worded everything much better then I did.
quote:Original post by alnite
Thanks for the replies. One more question before I decide to learn Managed C++. Is it practical to write algorithms where speed matters in Unmanaged C++, and then write its Managed C++ wrapper class? I am confused with the speed here since everything is linked in compile time (through projects), not runtime.


*scratch* Well.. speaking at the perspective of using Microsoft compilers, the speed between C++ (unmanaged) and .NET isn''t all that much, if at all depending on the situation. The .NET JIT compiler is fairly safisticated and takes advantages of specific hardware on the machine which your program runs on. The only real disadvantage with .NET in terms of speed is the slower start up process because it''s compiled on the fly.

Basically I don''t think it''d be worth the trouble even IF you could squeeze a few % in performance out of it (I''m still not all that sure that you can). If your program is at the point where a few % really matters, then you probably shouldn''t be using .NET at all and just go back to unmanaged C++.

This topic is closed to new replies.

Advertisement