People who learn to code to make games are likely to quit because they can't make the games they envisioned.
Learn the language first then move on from there. As for that there are a few ways to tackle this, as in which language to learn which will later allow you to move into gaming.
If you want to make 2d platformers or 3d games, learn C# or javascript (preferably C# since it allows you to venture into more areas). If you learn C# you can start off with making Windows (and Linux with Mono) desktop applications. C# is a very good language for its ease of use as well as its rapid GUI design. Later on you can venture into game frameworks such as Unity which uses javascript and C# as the two languages to access its game API.
If you want to make simpler games such as text RPGs or 2D platformers python and ruby are a good choice. They are both cross platform (can be ran on multiple operating systems) and have some kind of gaming library to ease of game development. Python is probably better in this regard since it has a library called pyGame which is meant for the task. Although I am partial to ruby for its beautiful syntax.
You can learn the harder (ish) languages such as C/C++ if you wanted as well, and then migrate into the unreal game engine which uses C++ to create its games.
So basically I would really only suggest 2 languages depending on your broader scope other than "making games":
C# if you want to make desktop GUI applications, and use Unity to create games once you are comfortable
Python is you which to make cross platform scripts for automating tasks or the like, then going on to use pyGame.
If you just want a nice language to learn from, Ruby is good and has plenty of learning resources like C# and python. Then if you want performance on Linux you can migrate to Crystal which has the raw performance similar to C.
Here are some resources for the various languages:
http://learnpythonthehardway.org/https://rubymonk.com/http://poignant.guide/book/chapter-1.html (my preferred resource to newcomers)
http://www.blackwasp.co.uk/Tutorials.aspx