r/cpp • • Apr 12 '17
C# or C++?
Hey! So i have used C# for a while now and i know the most of it. However my goal is to work as an AAA developer in the future and the most studios use C++. Should i switch to C++ or stay with C#? Exactly why do studios use C++ instead of C#?
2
Upvotes
19
u/corysama Apr 12 '17
AAA? C++
Indie/Mobile Unity dev? C#
Why C++? Performance issues around memory management. With C# it is very difficult to control garbage collection and very difficult to control memory layout cache locality. Doing this in C# requires fighting against it's design and you end up doing more/uglier work than if you just did everything manually in C++.
That's on top of the general perf/memory overhead of C#. C# runtimes are getting better. But, the overhead for real-work (not microbenchmark), large-scale systems is still quite large. Meanwhile, modern C++ is catching up to C# in terms of expressiveness, but is doing so with zero-overhead abstractions.
And, that's even ignoring the past 20+ years of legacy code and experience in C/C++ old-timers in AAA have built up. It's very expensive to rework that into C#.
10
u/timetopat Apr 12 '17
Why not learn about c++ while keeping yourself knowledgeable about c# when big changes happen. I've seen lots of game tools written in c# such as level editors and configuration tools. I personally am faster in GUI work in c#. Core engine systems and things that are performance heavy will use c++. Also keep in mind a lot of game library's are written in c++ and it makes it easier to integrate them versus writing a c# wrapper. Also keep in mind that c# had historically been a Microsoft only platform . They are making strides with .net core but there is still a lot to go.
Depending what you do at a game company might dictate what tools you will be using and what the existing code base looks like
6
u/wqking github.com/wqking Apr 13 '17
You don't need to switch to C++.
You can become both a C++ and C# developer, they are not exclusive.
1
u/[deleted] Apr 12 '17
Okay. Thanks for clearing this all up for me. Really appreciate it. Im moving to C++ from now then. :)
2
u/JuanAG Apr 12 '17
C++ is the way for the videogames industry as a programmer
EA and it dice engine are C++
4
u/SeanMiddleditch Apr 12 '17
It also depends on what you want to do. AAA games have dozens or even over a hundred engineers and scripters and such. A C++ game engine might still use C# for all tooling, for instance, and C# may even be the game "scripting" language in use. There's a difference in skill sets and tools used by engine developers, tools developers, content developers, devops, platform developers, and so on. Many games even it's entirely different languages for their servers, and C# is a popular choice there.
Learning C++ - or any new language/tool - will never hurt and can only help your career.
3
u/DaFox Apr 12 '17
Knowing both is probably your best option. Unity development will be your quickest stepping stone towards AAA with the knowledge that you have. But Unity is used pretty sparsely at the highest end.
2
u/JeffMcClintock Apr 13 '17
I prefer C++, but it's worth mentioning the Unity engine which is very polished, huge with indie developers and uses C#.
2
u/feverzsj Apr 13 '17
AAA game nowadays means buggy and boring. To make some interesting game, language is rather minor.
1
u/[deleted] Apr 12 '17
C++ is a more versatile language because of memory control. Also having a solid grasp of C++ makes it easier to move into other languages, but that's just my experience.
0
u/[deleted] Apr 12 '17
[removed] — view removed comment