TStoltz said:
Hi,
I'm sorry if this question comes inapropriate but hope you can help me
answer the following:
What is the difference between C++ and C#.
C# is a member of the C family of languages, much like Java. In fact it
shares many similarities with Java since both target a managed environment.
C# could be seen as a "simple" C++, without macros, templates, and multiple
inheritance. It adds first class support for properties and events, and
replaces function pointers with delegates, which are effectively type-safe
function pointers. C# 2.0 has generics which are similar in some respects to
C++ templates. C# also does not support deterministic finalization, since it
relies on the .NET garbage collector to handle memory.
Can I use C++ code within the C# code.
Not directly no. C# can call into other .NET assemblies, including ones
developed with Managed C++, or C++/CLI (both are basically C++ flavours
targetting .NET). Via COM Interop C# can call C++ code which was compiled
into a COM DLL, and via PInvoke C# can call C++ code compiled into a Windows
DLL.
Managed C++ and C++/CLI offer an additional interoperation capability called
IJW, which allows you to use unmanaged C++ code in your managed C++ DLLs.
Needless to say this is very useful if you have a lot of C++ code you need
to work with.
I've heard postive things about Framework which should be similar to MDSN -
or what is it better/worse?
Do you mean MSDN? If so, this is just the Microsoft developer documentation.
The Framework is the actual .NET system.
Please tell me why I should go for C-sharp instead of C++
There's no hard and fast rule here. Basically if you've decided to target
the .NET Framework, and you're not doing too much communication with C++
code, then C# will generally get your code out the door quicker and with
less bugs. This is a function of both the cleaned up syntax and the memory
management features of the .NET framework (which are also available with
Managed C++ and C++/CLI).
I much prefer C#, since I find it has a much cleaner syntax than C++ and
less ambiguities. Switching from C++ to C# led to a 50%+ developer
productivity boost on one of the projects I was involved in. That said, C#
is not a panacea for all ills, and sometimes you are better off with C++,
but these situations are few and far between in my experience.