For me, the answer would depend on both where you're starting from, what motivates you to learn and where you want to end up.
As others have said, the majority of low level coding in games is in C++ for performance reasons (typically complete control of memory allocations). However, within gaming, there are multiple layers of coding:
-
The game engine itself (presumably C++)
-
Scripts to control the behaviour of game objects (take your pick here, Lua, Unity uses c# I believe etc.)
-
Tooling - personally, I use C# here
If you're a complete newbie who doesn't know how to code, then TBH I'd start by learning to code in general, i.e. the application of logic using the medium of code. That can be anything from doing hacker rank challenges, to teaching yourself simple ways to get buttons on screen using WinForms etc. This doesn't have to be a long project, just get yourself used to coding anything*. Personally, if I was starting now, I'd pick either c# or python. Both of them come with easy to find dev environments (Visual Studio is free etc.) and there are lots of tutorials and the like available. Both of these will shield you from having to worry too much about memory allocation / deallocation patterns which you would then pick up on your next step (if you wanted to) of C++.
Given that you're not a complete newbie, then I'd be inclined to suggest either:
-
Use Unity and hence C# to control your game objects
-
Use the below mentioned UWP approach and write a game using C#. Subsequently porting the code to C++ can be a step 2 if you need to / want to. Certainly for me, going from an event driven view of the world (WinForms / server programming in C#) to a polling based approach (of having to do something 60 times a second and checking whether something else has happened) was a bigger change than the actual language.
Point #1 is probably also more applicable if you're looking at more commercial options I'd guess, unless you desire to be a low level programmer within the team.
Note for games, if you're writing for the Xbox 1, then, under the creators collection program, you can write a UWP application in C# and have it run on the console. Clearly this won't give as much control as the C++ layer would, whether or not that's relevant would depend on your game. As mentioned previously by @Fulcrum.013, if you're dead set on never dropping a frame at 60fps, then get used to C++, if it's a card game or something with simpler requirements, then you'll almost certainly get away with C#.
As for me, I started back in the day with Basic then, C and ARM assembler (1990s) before moving to Java and then to C#. For game creation, C and assembler were kings back in the day. MS introduced XNA which was exciting as I could write a game in the same language I used in my day job (which inspired me to create a game again). MS then realised that with DX10+ that the model they were using wasn't going to work with being able to drive the GPUs fast enough and so they've invested heavily in getting people to use C++ again. Note that the modern versions of C++ are so much easier to use that using it actually isn't that bad (I've certainly removed my hatred of it, but I still prefer C# for everything else in my stack).
Hope this helps
Steve
*My thinking here is that once you understand coding, different languages add / remove portions - especially memory management which can be tricky at first!