Sign in to follow this  

Python for 1st language?

This topic is 720 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys,

 

I'm hoping to learn how to program games for PC. So far, I have read and researched that C++ is the way to go, but for a complete noob such myself, it is not the best language to start with.

 

I've been told that Python should be my 1st programming language and after a while it would make it easier for me to start learning C++.

 

Do you agree with this statement? Or would you suggest a different language or maybe go right into C++?

 

I can devote about 25-30 hours a week for learning.

 

What I am looking for is the most efficient way of reaching that ultimate goal of ability to program a PC game. For now, I would like to have enough skill to make a simple prototypes to test game mechanics and at least be familiar enough with coding to be able to modify already existing code written by someone with more experience.

 

Any other advice on the topic would be appreciated!

Share this post


Link to post
Share on other sites
What I am looking for is the most efficient way of reaching that ultimate goal of ability to program a PC game.

 

 

If I knew what this was I certainly wouldn't be willing to tell you for free, and neither would anybody else. :)

 

Your plan to start with Python is good; as Bregma said, you're plan to avoid C++ first is also good.

 

Find some introductory material for Python you can follow -- the Python website used to have tons of "getting started" and whatnot guides aimed at programmers and non-programmers alike, and probably still does -- and start with it. Build the exercises they suggest. Build exercises you set for yourself, like a simple "guess the number" game, or Blackjack, or Hangman. All of these can be done fairly simply without having to worry about the complexities of windowing and graphics APIs and are good ways to grow as a beginning programmer.

 

Once you feel comfortable, post those games somewhere here or elsewhere on the interest and ask for feedback with your code. Keep making simple text IO based games until you feel like you are ready to tackle learning a windowing and graphics API, and then pick one up and go for it.

Edited by Josh Petrie

Share this post


Link to post
Share on other sites

Nothing wrong with Python as a first language, but if your eventual goal is PC programming with C++, you may want to start with C# instead. Difficulty-wise it's roughly equal to Python, and it's closer to C++. In terms of game programming C# is probably easier than Python with better libraries and frameworks available.

Just quoting to say I agree with this idea. There is nothing wrong with Python as a first language at all, it is a solid choice but c# is a very nice language, if you are on Windows you get a fantastic IDE to use (Visual Studio 2015 Community edition) and as SiCrane points out it's closer to c++ than Python is so I think it would be a better stepping stone.

Share this post


Link to post
Share on other sites

I have honestly always gone the other way with this advice, seemingly opposing the rest of the planet. But it worked for me.

 

I think the important question is how you look at coding:

Is the idea of programming in your head an idea you enjoy?

OR, is writing code something you see more as a means to an end, and it's more about making games?

 

Since your post sounds more like the latter, then yes, the advice others have offered here is probably what I'd suggest too.

 

So just sharing my personal take here: I jumped straight into C++ and I have to tell you I am always happy that I did. I am always thankful that C++ is "The thing I got used to", rather than "The thing that's more complex and irritating than the thing I got used to." However, yes, disclaimer: I was just interested in/excited by any coding at all, and learning "the hard one" was itself the motivation for me. I only carry on about this perspective because, having learnt C++ first, every other language I've picked up since has been a real doddle.

 

(Nothing wrong with having Python under your belt either anyway; it definitely has its advantages over C++, especially when you want to throw things together. But from your OP, I'd agree C# is probably what you want.)

Share this post


Link to post
Share on other sites

I recommend learning C.

In the long run, it would be the best way to start programming.

It teaches you basic concepts, memory operations, how software work.

Then start an higher level language like C# or C++, then you could focus on software development.

How to design OOP systems, how to build engines, etc... 

 

Python is a nice scripting language that could be used for many objectives.

However, it is not recommended for first language since you don't dive in into software. 

Edited by WoopsASword

Share this post


Link to post
Share on other sites


I recommend learning C.

 

I recommend the OP not do this. I also recommend that the OP only uses the tools needed to do the job and do the job well. C does not fit that criteria.

Share this post


Link to post
Share on other sites

Before you make up your mind, I recommend you consider JavaScript. JavaScript, as you may know already, runs in your web browser which is a very capable platform for games. And there is no end to the number of game programming libraries and tutorials out there to get you started.

 

Plus, if you write something you want to share, all you need to do is host the files somewhere and share the URL. No one needs to download or install python. You don't have to mess with py2exe or anything like that. It couldn't be easier.

 

A great place to start is with phaser.

Edited by smr

Share this post


Link to post
Share on other sites

 


I recommend learning C.

 

I recommend the OP not do this. I also recommend that the OP only uses the tools needed to do the job and do the job well. C does not fit that criteria.

 

 

[moderator edited]

 

C is a good choice by all means. You did not state a single reason not to.

 

Edited by frob
Moderator edit

Share this post


Link to post
Share on other sites

Hey I`m that guy who started learning python to make some games, ulimatly i made soe android games using a nice library called kivy. 

BUT there was a lot missing  from my arsenal of knowledge so for about 2-3 months now i am learning c/c++ and also started a few days ago to read a nice tutorial from lazyfoo on SDL. So Yes python is easier but if you`re in it for the long haul I also recommend going for c first , then go for python or continue learning the "++" ;). Good luck dude!!!

Share this post


Link to post
Share on other sites

 

 

I recommend learning C.

 
I recommend the OP not do this. I also recommend that the OP only uses the tools needed to do the job and do the job well. C does not fit that criteria.
 
[moderator edit]
C is a good choice by all means. You did not state a single reason not to.
 

Pointers. No string type. By themselves, those are reason enough for a beginner not to use C.

Fundamentally, you spend more time fighting the language than learning to program.

Oh, and for the record, I started in C.

Edited by frob
Moderator edit

Share this post


Link to post
Share on other sites

With my moderator hat on:

Insults and personal attacks on other members will not be tolerated.  I have edited some posts, it needs to stop.

 

 

 

 

With that out of the way...

 

 

 

C is a great language. Learn it if you want to. It will teach you many things.  However, it is a different language than Python, or C++, or Objective C. C has a much deeper learning curve than many of the other recommendations.  C requires a deeper knowledge of various topics like object lifetimes and memory management and pointer manipulation that are common for beginners to get wrong.  Even back in the 1970s and 1980s C was not generally recommended for a first language.

 

You do not need to learn other programming languages or parent- or grandparent-languages to learn today's programming languages. Going through Wikipedia's history of programming languages, you don't need to learn Autocode, or IPL, or Flowmatic, or Fortran, or Lisp, or Algol, or Fact, or Cobol, etc., to master today's languages.

 

As far as programming languages go, C++ is usually not recommended as a first language. It has a high learning curve and it works off the assumption that you know what you are doing, which beginners rarely do. It requires the programmers understand details about object lifetimes that beginners often struggle with. It is something you should learn eventually because it is (currently) the primary language of systems development, and most game engines use it these days.  Nothing is poised to replace C++ right now, but history says eventually it will be dethroned and another systems-friendly language will replace it.

 

Python is frequently recommended as a first language. It is powerful, handles most of the object lifetimes automatically, has many good game development libraries, and is often used in game development scripts.

 

C# is frequently recommended as a first language. It is powerful, handles most of the object lifetimes automatically, has a few good game development libraries, is used by some major engines like Unity, and is frequently used in game tools.

 

JavaScript is sometimes recommended as a first language.  It is everywhere, handles most of the object lifetimes automatically, has ever-growing usefulness with HTML5, and has plenty of learning tools available.

Share this post


Link to post
Share on other sites


JavaScript is sometimes recommended as a first language.  It is everywhere, handles most of the object lifetimes automatically, has ever-growing usefulness with HTML5, and has plenty of learning tools available.

 

I have only moderate experience with JavaScript. 100% agree that it's an incredibly useful language to know (in fact, it's almost mandatory these days), but from my limited experience, I found the language itself to have a few weird quirks that are potentially confusing to a beginner (more so than C# or python anyway).

 

Interested to hear your opinion on this.

Share this post


Link to post
Share on other sites

I don't like JavaScript, I find a lot of the scripting things are an abomination.... but I know several people who recommend it for a first language.  

 

There are great debugging tools in Chrome and most budding young programmers already have it installed. Tutorials are easy to come by.

 

For a beginner, someone who is just learning to understand the basics of programming, I can see the appeal. Free hosts are everywhere, it takes about five minutes to get a WordPress site working. Inside that you can immediately drop in a bunch of HTML elements and script them on the same page.

 

For the newcomer there are no worries at this point about memory leaks, or buffer overruns, or seemingly-complex function calls, or inclusion from other files and libraries.  It takes a lot of hacking and experimentation, but if you get it wrong nothing is going to break. You don't get the jokes about undefined behavior doing 'anything including maybe crashing or formatting your computer'.  At worst your web page doesn't display.

 

So while I dislike a lot of the more advanced things --- for example I just spent four hours today fighting stupid variations on box models on different handhelds --- for the beginner JavaScript is approachable and relatively friendly.

 

Also, it is a language most programmers are going to need to work with eventually. It is one of the first five languages I recommend programmers get exposed to.  Those are Python, JavaScript + HTML, C++, C#, Java. You don't need to know them well, but if you are going into games you'll likely be exposed to them all, and they are closely related to each other to the point where learning the last few will come quite quickly.

Edited by frob
Spelliking and small addition

Share this post


Link to post
Share on other sites

When you are programming against the canvas, you don't have to worry about subtle (or not so subtle) differences in the rendering engine of the browser. Also, while JavaScript does have differences when compared to other, more typical object oriented languages like python and C# (some call these quirks), you can avoid many of them by using a cross-compiled variation of JavaScript. TypeScript has been seamless in my experience using Visual Studio 2015, and TypeScript emulates the typical class/interface paradigm that most people are comfortable with and will give the newbie more of a leg-up when transitioning to another object oriented language.

Share this post


Link to post
Share on other sites

I would say that if you are completely unfamiliar with computer programming that Python is a good start, it is a language emphasizing readability which is useful for beginners. However, in my opinion it is not the best language for programming multi-platform games. If you want the basic of computer programming and some basic syntax then learn Python. If your intention is making games on a low budget I would suggest a game engine such as Unity. It is free for the personal version and comes with just about everything you'd need to make great games for PC or other operating systems, plus WebGL and Unity's built-in Webplayer. Unity uses C# (a relatively easy to learn object-oriented language) and JavaScript (definitely a language to know!). Also, there are tons of great tutorials on using Unity.

Edited by AJrules23

Share this post


Link to post
Share on other sites

I'd advice in favor of Python over C# simply to have something different to chew on. Make no mistake, I love curly braces languages, but certainly having programmed in something else (Python, or Pascal derived languages like Ada or Delphi in my case) does broads a bit the understanding of what is a programming language.

 

Otherwise you risk just hanging on too much on the syntax when learning new things.

 

Moreover, starting with an all Microsoft stack (VS for C#, VS for C++) also has the same consequences. Last thing I want is more people calling auto-complete in every IDE "intelli-sense" :P

 

So Python is a good choice. Used a lot on Linux distributions, very broad scope (from tiny scripts to web sites and games). All in all, a good experience. Later you can jump on the "mainstream" stack of Visual Studio, C++, D3D, etc.

Share this post


Link to post
Share on other sites

Another vote for python. 

 

For a start I have created tutorials for it as well as the Godot Game engine which uses a Python like syntax to make games called GDscript.

 

You could pick up GDscript pretty fast and be that much closer to making your game already. You don't have to go through the bottom end to get to the game development phase. 

 

Maybe this will set you on the right track:

https://github.com/TutorialDoctor/Software_Development

 

And If you have any questions contact me on twitter or here. 

Share this post


Link to post
Share on other sites

This topic is 720 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this