I am a big fan of out-of-the-box thinking. When we can find unusual ways to come up with solutions, it can enhance the results and we can discover different ways to do things. But, sometimes, it pays to think inside the box. For instance, I've seen several articles online about coding games to learn Python.
It seemed like a great idea to me, at first. When trying to learn a computer language such as Python, why not use game programming as a use case to keep me interested?
Disclosure: Website owner may receive commissions for purchases made through the links and banners on this web page.
There are hidden pitfalls in doing this. The biggest problem is you now have more on your plate to learn. You won't be learning about just programming in Python. You also need to learn the inner workings of the game engine you are programming.
Don't get me wrong. Game programming is fun. If it's something you feel you want to pick up, then by all means find a good game programming engine and learn the coding behind it. But, my advice is to not use the paradigm to learn programming in a given language.
Game Programming Won't Teach You Data Science
Another snag with learning Python via programming games is that game programming isn't related to data science. It certainly is possible to incorporate machine learning into games and this trend is starting to grow. However, the game programming engines are not at this point, yet.You won't get learn the techniques you need in the data science discipline when you concentrate on learning a language such as Python using game programming as the means to learn.
Of course, one could argue that you could use game programming to teach others about data science. This is true. But, someone who is trying to learn Python won't be at a stage in their learning progression to teach data science. Even when they learn the game programming engine, they won't apply data science concepts in the game unless data science concepts were learned on the side.
Your Learning Won't Be Complete
When you use a language to program a game, you will use the methods and components necessary to program that game. However, game programming isn't known for performing tasks such as reading databases or for processing forms of users. It certainly can be done, but this usually isn't what you would use the game engine for. I already mentioned the fact that data science concepts won't be utilized or taught.
The Programming Language Is Not the Focus
When you read or view tutorials about the game engine you are working with, they won't focus on the programming language. They will give you a few tips on how to use the language but only for the purposes of making a game. The focus is the game components.
Game Engines Have Their Own Scripting Languages
It's typical for a game engine to create a scripting language that is specific to that engine. It's not necessarily that the creators are trying to make proprietary aspects of their products, although that may be the motivation for some. It's more likely that the scripting languages of these engines are used to tie together the components of the engine. In other words, an outside language, such as Python or C#, won't be specific to the engine. That means you will need to retrofit several aspects of the programming language to obtain the desired results. With an internal scripting language, it is integrated with the engine.There is no retrofitting. Everything is there when you need it.
I should give you a heads up that popular programming languages such as Python and C# are starting to integrate into the bigger engines. Unity already uses C#. After all, it is developed by Microsoft. Godot now supports multiple languages. It's likely the future of these engines will have these popular languages integrated naturally.
Aspects of the Game Engine Won't Be Useful for Other Applications
If you use game programming to learn Python, you'll use Python for aspects of the game engine that won't be useful when you start using the language elsewhere. That means you will spend an inordinate amount of time learning about components that will only be useful for game engines. Unless you plan on programming game engines, which is a worthy goal, it may not be what you want.
But, Geeks Just Wanna Have Fun!
I already mentioned that game programming can be a fun way to pass your time. They'll even be several people that take their game programming skills to a higher level and start making money with it. That's great. But, if your focus is to learn Python programming, there are better ways to accomplish this objective.