0

C++ vs. C#

In a nutshell, what's the difference between these languages and their respective advantages and disadvantages? Thanks in advance.

13th Nov 2016, 1:43 PM
Adriano Armani
Adriano Armani - avatar
2 Respostas
+ 4
C# is actually very similar to Java, in that everything lives inside classes, which isn't the case in C++. C++ is also a bit closer to the metal, and you have tons of control over memory management and you deal with memory addresses a lot (pointers). C# is a bit more flexible than Java in that respect in that you can access raw memory if you insist, but in practice you never do. Also you need to mark functions handling pointers as "unsafe" which tells you how much the C# folk like doing that :P If your primary concern is getting as much performance as possible then C++ is the way to go (say, game developers are doing C++) because you have control over everything (which also means you can mess everything up badly). The huge advantage C# has is that it interops nicely with the .NET-Framework which has tons of features, but at the same time this can be a disadvantage since you're tightly coupled to the Microsoft ecosystem. As far as languages go, the two are pretty different. Don't let the similar name fool you :P "Choosing" one or the other depends on what you are trying to do.
13th Nov 2016, 2:15 PM
Schindlabua
Schindlabua - avatar
0
Thanks for the answer.
13th Nov 2016, 7:03 PM
Adriano Armani
Adriano Armani - avatar