Sign in to follow this  
biggjoee5790

Python to C++

Recommended Posts

Im brand new to Python and decided to learn it before C++ after various articles and people here recommended it for someone who eventually wanted to program games and had no prior experience. Well I started learning and I am progressing pretty well. My question is, how will I know when I am ready to learn C++? I know that I want to eventually because most modern games are coded in C++ and almost all job requirements for video game companies that I looked at required knowledge of C++. Im guessing I should only learn a new language when I can use Python 100% The problem is, how do I know that I have Python completely learned? Is being able to make any type of program easily a sign of being "fluent" in the language? I read that its not a good idea to switch languages until you learn your current one really well, so I want to make sure that I know when I am ready to move on. Since I want to make games, im guessing I should learn Python to the point where I can actually make 2d and 3d games with it. I know Im just a beginner, but im just curious as to what makes someone advanced in their language.. hope I make sense :) thanks in advance

Share this post


Link to post
Share on other sites
Quote:
Original post by biggjoee5790
The problem is, how do I know that I have Python completely learned?


Python may appear simple on the surface, but it's actually quite complex; you could spend quite a bit of time before you master it.

My advice would be to start learning C++ after you make a few simple games with PyGame. People recommend Python to beginners rather than C++ because Python lets you learn basic programming concepts with less trouble. After you've completed a few small projects, you should know enough to comfortably start learning C++.

Share this post


Link to post
Share on other sites
There are four things involved here:
  1. Writing programs in Python (both knowing what statements do, and how basic actions are done)
  2. Writing programs in C++ (same as above)
  3. Algorithmic skills (knowing what to write to solve a problem)
  4. Developer skills (knowing what code can cause problems on the long term)


The main reason why Python is advised before C++, is that learning 2. is easier when using Python than when using C++. However, in itself, 1. is irrelevant to how you code in C++ or how easily you can pick it up: the important thing is that you learn general programming and algorithmic concepts that are independent of Python and can be used in C++ as well.

What you should look for is not ability (to write a program in Python), but rather maturity: having a justified opinion on technical things, being able to constructively criticize other people's code, complaining rightfully about language or machine limitations, having the courage to refactor ugly code, and being able to see your own mistakes from a few weeks ago and correct them.

As for developer skills, my pessimistic outlook so far is that, regardless of the language, you can only learn this through repeated failure.

Share this post


Link to post
Share on other sites
I wouldn't worry too much about learning C++. If you learn one language well transitioning to a new language is not as hard...of course transitioning to C++ is probably one of the harder transitions. Really you should only transition to C++ if you need to...ie when python doesn't let you do what you want to do which is typically a speed issue. A good engineer learns to pick the right tool for the job, and I think most of what you want to do you can do in something other than C++.

I am guessing you are younger like a lot of newbies, so why spend a great deal of time learning C++ just because it is the industry standard now. Who knows where it will be when you want to enter the industry. With the way architecture is changing in the future there will likely be a language takes advantage of the changes better than others.

Share this post


Link to post
Share on other sites
Ok so I will pretty much know when I have "mastered" the language. I understand what you mean by that. Im going to learn everything I can in Python all the way up to making 3d games. Im sure that by the time I can comfortably program something as complex as a 3d game, Ill definetely be able to tackle the C++ language if I need to. Throughout my learning I should have learned all the general programming concepts that are constant regardless of what language you use, that way, instead of just mastering a language, I will have mastered programming in general. Hehe obviously by mastered I dont mean like the greatest programmer ever :)

Share this post


Link to post
Share on other sites
One thing to look for is when you start finding things that you want to do in Python that you can't do due to limitations in the language. A language is a tool for getting things done - some languages are very tightly focused on specific tasks, while others like Python and C++ are 'multitools.' If the tool does what you want, and you're comfortable using it, then stick with it until it doesn't do what you want anymore.

Incidentally, the use of Python within the games industry is on the rise. I seem to recall that the whole of EVE Online's server software is written in Stackless Python, for example.

Share this post


Link to post
Share on other sites
Quote:
Original post by superpig
One thing to look for is when you start finding things that you want to do in Python that you can't do due to limitations in the language. A language is a tool for getting things done - some languages are very tightly focused on specific tasks, while others like Python and C++ are 'multitools.' If the tool does what you want, and you're comfortable using it, then stick with it until it doesn't do what you want anymore.

Incidentally, the use of Python within the games industry is on the rise. I seem to recall that the whole of EVE Online's server software is written in Stackless Python, for example.


Ok so stick with Python until I need to learn something else for whatever reason, whether it be to make a program that Python cant handle or some other reason.. I gotcha. And you are correct about the use of Python in gaming. I know that Firaxis created Civilization 4 totally in Python. Im enjoying Python so im not really in a rush to learn a tougher language (C++) until its necessary. If Python is fully capable for programming a modern 3d game, which it appears that it is capable, theres no reason for me to be in a hurry to learn a new language.. thanks alot for the help.

Share this post


Link to post
Share on other sites
I was curious about 1 other thing. In the last week ive been learning Python, Ive been messing around with various online tutorials and stuff. Im really looking for a good book that teaches everything you need to know about Python. Something thats well structured with chapters, exercises, examples, etc. I really learn better when theres structure in the lesson. Do you know of any Python books that are really good? Ive seen ones on Amazon but the reviews say that they are best for people who have experience and are learning Python as a 2nd or 3rd language. I need something aimed at the total beginner who is learning how to program for the first time.

Share this post


Link to post
Share on other sites
Quote:
Original post by biggjoee5790
...
Ok so stick with Python until I need to learn something else for whatever reason, whether it be to make a program that Python cant handle or some other reason.. I gotcha. And you are correct about the use of Python in gaming. I know that Firaxis created Civilization 4 totally in Python. Im enjoying Python so im not really in a rush to learn a tougher language (C++) until its necessary. If Python is fully capable for programming a modern 3d game, which it appears that it is capable, theres no reason for me to be in a hurry to learn a new language.. thanks alot for the help.


Well, I can kinda relate to your problem, as I am currently writing my first CPP game, and I started with Pygame too. But being a great python lover, I gotta say that you can probably never master python (unless you are Guido Van Rossum). Nor should you try, as people said - python is a tool. A very good tool. If you are writing an engine, python can be its scripting language. But python isn't mature enough to create real complex and fast graphics engines, because it's an interpreted language. I know someday it will be good enough, and I know that with tools like ctypes you can get close, but not good enough. So you should try learning the library (Pygame -> sdl, PyOpenGl -> OpenGl) in python and then going to CPP, it will make you life easier - first learn the concepts, than dive into the small, boring and unfulfilling stuff (like memory managment etc.).

That said, I gotta say that I think you should learn CPP asap, so that you can compare python actions to CPP and translate between them.

Mikle
P.S - Python is better than CPP :) I said it, sue me...

Share this post


Link to post
Share on other sites
Quote:
Original post by Mikle3
But python isn't mature enough to create real complex and fast graphics engines, because it's an interpreted language. I know someday it will be good enough, and I know that with tools like ctypes you can get close, but not good enough.


How good is 'good enough,' though? You don't need to max out the framerate. You only need to keep it high enough that the game is playable.

If you're making Crysis, then sure, maybe the overhead inherent in Python is too big a hit to deal with, but if you're making comparatively simple games - as most beginners and indies are - then you're not often needing to squeeze so much performance out of the CPU that the overhead becomes a problem.

Share this post


Link to post
Share on other sites
Quote:
Original post by biggjoee5790
I was curious about 1 other thing. In the last week ive been learning Python, Ive been messing around with various online tutorials and stuff. Im really looking for a good book that teaches everything you need to know about Python. Something thats well structured with chapters, exercises, examples, etc. I really learn better when theres structure in the lesson. Do you know of any Python books that are really good? Ive seen ones on Amazon but the reviews say that they are best for people who have experience and are learning Python as a 2nd or 3rd language. I need something aimed at the total beginner who is learning how to program for the first time.


BeginnersGuide

Share this post


Link to post
Share on other sites
ok so any tutorials recomended for beginners on python.org would be ok? I wasnt sure if online tutorials would be as good as actual books, but it seems like there are some good ones.

Share this post


Link to post
Share on other sites
Well, there's nothing stopping you from reading the online tutorials and then reading the books later. If you want to start with a book then there's an "introductory books" link on that page.

Share this post


Link to post
Share on other sites
Quote:
Original post by biggjoee5790
I know that Firaxis created Civilization 4 totally in Python.


Nope They used Python for some of the game logic. The rest of the game logic and everything else was in C++.

Share this post


Link to post
Share on other sites
Quote:
Original post by Glak
Quote:
Original post by biggjoee5790
I know that Firaxis created Civilization 4 totally in Python.

Nope They used Python for some of the game logic. The rest of the game logic and everything else was in C++.
Also the GUI.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kazgoroth
Quote:
Original post by Glak
Quote:
Original post by biggjoee5790
I know that Firaxis created Civilization 4 totally in Python.

Nope They used Python for some of the game logic. The rest of the game logic and everything else was in C++.
Also the GUI.



ahh I thought it was the entire game.

Share this post


Link to post
Share on other sites

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