...This is a spam OP post... note that the OP didn't even pretend to actually ask a question. Whatever, it doesn't really matter.
But here's my two cents on C# and C++:
C++ is of course much more powerful, but I find C# much quicker to make a variety of programs in than C++, and much easier to spot bugs in. For example, you want a stack trace? In C# it's just Environment.StackTrace. In C++, there is no standard solution, you either need to use a specific compiler, and write your own wrappers, or use an external library like boost or StackWalker.
C++ has so much "gotcha" behavior when you get into the nitty-gritty details. For example, the fact that short-circuiting does not happen when you use an overloaded && or || operation. There's other examples, but in general it's just not intuitive behavior at times. The concept of "undefined behavior" means that your program will never be completely secure unless you provide wrappers around places that may expose undefined behavior, such as preventing integer overflow with checks before you actually perform the addition or multiplication. C#, on the other hand, has a simple "checked" keyword that will throw an exception on overflow, instead of causing your whole program to become illegal.
C# intellisense/compiler errors tend to be very clean. C++ compiler errors are the opposite. Considering that templates in C++ are turing complete, and that the syntax of C++ is just more complicated in general, IntelliSense tends to be horrible at diagnosing all the possible problems, and template compiler errors just look horrendous in C++.
And as Thomas1965 noted, C# does have operator overloading, but the degree of freedom that C++ allows in operator overloading can be more of a curse than a blessing, at times. Sure, for many aspects of C++, once you learn about them you can consciously avoid doing them, but, in a nutshell, what I'm saying is that there are so many more ways to do something wrong without knowing it in C++ than in C#.
In C#, I dislike the "using" feature when working with disposable objects. As a user of a class, I shouldn't have to know whether or not something is Disposable and I need to handle it differently, else have some sort of resource leak. This is where C++ destructors are actually really useful, although problems with C++ destructors include knowing that you shouldn't ever throw an exception inside of a destructor, another gotcha.
I also like how C# limits the use of macros.
I admit I have not done multi-platform programming C#, but I thought C# has been pretty stable with support for other platforms for a while now.
panel123 wrote: |
---|
And the biggest difference is that C # is a type-safe language (unlike C ++ |
What? I would say both of them can be equally non-type-safe, at times. The abusing of Object base class in C# is just as bad as abusing void* casting in C++. C++ is more type safe in that you can rely on static templates instead of weird inheritance runtime checks.