I'm in the planning stages of writing a vector graphics program. I've already done a simple one in VB.Net. I now am programming in C# but I'm wondering if Visual C++ would be a better language for me. Can anybody give me a heads up on what language I should look closer at?
Thanks, Richard
Loading
Posted Jun 16, 2007, 9:51 AM
AlanPosted Jun 16, 2007, 8:22 AM
There are three reasons why you might want to use Managed C++ (Managed extensions for C++ or, in VS 2005, C++/CLI) rather than C#:
1. The Managed C++ compiler can do some optimizations when producing MSIL which can enable the JIT compiler (which is very sensitive to changes in the MSIL) to produce slightly faster native code.
2. If you need to use a lot of unmanaged calls to GDI+ or Win32, then Managed C++ can deal with these much more seamlessly than C# (which always uses P/Invoke) using a technique known as IJW ('it just works') which has been renamed C++ interop in VS 2005. This technique enables you to embed unmanaged code inside a managed assembly and so both types of code can co-exist in the same program.
3. Slightly more of the CLR's capabilities are exposed in Managed C++ than in C# and, in VS 2005, the former supports templates as well as generics.
However, the big drawback to using Managed C++ is that it's far more difficult to learn and use than C# and so, unless you have a background in unmanaged C++ or the above considerations are important to you, I'd stick to C#.