Is it good practice for game development to learn multiple languages?

Started by
12 comments, last by Luna Wu 8 years ago

I've been learning C++ for a while now, and I used SFML at first for game development and made a pong and a breakout game, , but due to problems with displaying images that I found no solution for, I switched to Allegro5, and I'm finding it quite hard to use, I only made a pong game in about 10 days (and it was very hard for me), and it's also kinda sloppy , I am now learning python and pygame besides c++ and allegro5, I've finished 4 games in python and pygame in the time I could have finished only 1 game in allegro/C++ that's also sloppy and badly made, I know the FAQ on this site advises using python first and not c++, but, I was wondering if that could teach me bad practices and not make me 'get used to' making somewhat more complex (to me) stuff in C++ that I think I will definitely need in the future. Could anyone please help/advise me ? Thank you so much :)

Dream in the shadows

Advertisement

Learning how to make a game is going to be largely the same across languages. The specifics of how many of the parts work, or access memory, or what-have-you might be very different, but something like a finite-state-machine or a straightforward game-loop. Learning a language can be an endeavor all on its own, and adding learning a language to that amount of work can definitely affect the outcome of both efforts.

That said, people have implemented pong and breakout games using SFML before, and I'm sure with Allegro5, too. I think it's important to understand what about those were difficult for you.

Inspiration from my tea:

"Never wish life were easier. Wish that you were better" -Jim Rohn

soundcloud.com/herwrathmustbedragons

The SFML one wasn't difficult at all, the problem I'm having is with allegro (the movement and physics of games is harder for me to implement with allegro5)

Dream in the shadows

Learning a new language can be fun; occasionally you will find something neat that gives you a new idea of how you can solve a problem in other languages you already know.

As far as good/bad practices go, it's hard to know at first. Eventually you'll start to get some insight about what's good and what's bad after using different things yourself, and participating in discussions about particular ways of doing things. For now I suggest to just keep doing whatever works, and if you start running into headaches, try to find out if you're doing something wrong at that point. Usually it's not too hard to go back and fix mistakes. Most of our programming time is spent trying to decide how to do something in the first place. It's pretty easy to take a solved problem and implement it differently.

Sometimes when something feels hard to use, it's because the way it is meant to be used is different from how you're trying to use it (if you see people say "idiomatic", that basically means "the way we usually do it in this language/library"). I usually try looking for complex samples that demonstrate how things are supposed to be used. This kind of thing bit me hard when moving from WinForms to WPF.

I haven't used SFML. Last time I used allegro was during the DOS era, so I'm not sure what it's up to lately.

I think programming itself is language independent. Programming is fundamentally the ability to create a series of logical instructions, often utilizing mathematics.

A programming language, much like a spoken language, is a form of expression of the intended thought. Learning a new language can give you new insights into how to express your thoughts, but they don't necessarily make your thoughts better. That only happens through practice with the intent to improve.

I am pretty good at the language independent programming stuff. I can pick up another programming language in a few days and become reasonably proficient (excluding joke languages like Malbolge and brainfuck). The thinking process is "I want to do this action ten times, how do I create a for loop or a while loop, or repeat this series of instructions 10 times in this language?" After that, it's just a quick lookup of language syntax and I'm on my way.

Is it good practice for game development to learn multiple languages?


It is important for ALL programmers to learn multiple languages. They each have different idioms, strengths, and weaknesses. Even if you never _actually_ use a language, learning about that language and how it solves certain problems makes you an all-around _better programmer_. e.g. I never use Ruby myself, for instance, but having spent some time learning it I've learned some new tricks about DSL design and library design in C++ for improving DSLs, as well as having been able to speak competently and authoritatively to external Ruby developers.

Modern games are often also typically written in a variety of languages. Our project's engine, tools, and backend services are written with a combination of _at least_ C++, C#, Python, Lua, ActionScript, Java, Perl, Ruby, and Erlang, and that doesn't even include our build system which uses a mixture including _at least_ CMake, POSIX shell, PowerShell, Python 3, cmd.exe batch, PHP, and SQL.

This is basically just another version of the adage, "if all you have is a hammer then every problem looks like a nail." Languages are just tools. Learn how to use as many of them as you can, and then select the appropriate tools for the correct jobs. A good rule of thumb is to try to competently learn at least one new language every year (you don't need to master them, just become comfortable reading and maintaining small projects written with them).

So learn Python for making your game. Also make a C++ game. Use Unity and C#. Make a Java game. Put together a website for your games in PHP/SQL/HTML/CSS/JavaScript. Learn as much as you can, and never ever stop.

Sean Middleditch – Game Systems Engineer – Join my team!

As other have said, learning other languages give you more tools than just a hammer.

That said, I would argue that it is pointless just learning languages that are almost the same, Just C style for example, as you will not learn new techniques. It is definitely worth stepping out of the imperative world and learning something like Lisp, F#/ocaml, Haskell or the like. Haskell is a beautiful mind blowing language with real purity of thought. These will transform your thinking in so many ways.as they are more focused on what and not how. Even C# Linq which borrows from the functional world.

I started my journey into functional a couple of years ago and it has effected my day to day C#, my code is cleaner and easier to compose because of it :)

Is it good practice for game development to learn multiple languages?


It is important for ALL programmers to learn multiple languages. They each have different idioms, strengths, and weaknesses. Even if you never _actually_ use a language, learning about that language and how it solves certain problems makes you an all-around _better programmer_. e.g. I never use Ruby myself, for instance, but having spent some time learning it I've learned some new tricks about DSL design and library design in C++ for improving DSLs, as well as having been able to speak competently and authoritatively to external Ruby developers.

Modern games are often also typically written in a variety of languages. Our project's engine, tools, and backend services are written with a combination of _at least_ C++, C#, Python, Lua, ActionScript, Java, Perl, Ruby, and Erlang, and that doesn't even include our build system which uses a mixture including _at least_ CMake, POSIX shell, PowerShell, Python 3, cmd.exe batch, PHP, and SQL.

This is basically just another version of the adage, "if all you have is a hammer then every problem looks like a nail." Languages are just tools. Learn how to use as many of them as you can, and then select the appropriate tools for the correct jobs. A good rule of thumb is to try to competently learn at least one new language every year (you don't need to master them, just become comfortable reading and maintaining small projects written with them).

So learn Python for making your game. Also make a C++ game. Use Unity and C#. Make a Java game. Put together a website for your games in PHP/SQL/HTML/CSS/JavaScript. Learn as much as you can, and never ever stop.

I was going to reply with a long rant about how it is absolutely a great thing to learn multiple languages, but then read Sean's post and felt he stated my rant in fewer words.

When you first start out the important thing is to get your feet under you. If you can do small projects comfortably in SFML then you're on the right track. The danger is in using alternatives as a means of running away from things you don't understand. Ideally you want to reach a point where you feel good about the language you're using and then take up another language just to see what it is and what you can do with it. If you fall into the habit of running away any time you find a difficult problem then you're only going to become incompetent in many different languages. Beat the problems to get stronger and branch out from that position of strength.

Incidentally, there are a lot of people who can't do what you've done so far, so keep going.
void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

Beat the problems to get stronger and branch out from that position of strength.
QFE

It's normal that you run into seemingly impossible problems. If that happens, figure out how to beat them. Find out what exactly is blocking your path. See if there is another way in (maybe you started at the wrong end). Try to find examples that do what you fail to do. Study them. Understand why they work. Read discussions about the same problem at the Internet. Make a small example demonstrating the problem, and post it.

Switching to Python + pygame is good for learning a new language, but every language, including Python, has its own set of impossible problems that you eventually will run into.

This topic is closed to new replies.

Advertisement