PDA

View Full Version : c++ v.s. Python


ubik
11-02-2005, 01:17 AM
which would be a better first high level language to learn? no prior programming experience. Do you believe Python's easy to follow syntax is more "Newbie" friendly than C++ ?

gsoft
11-02-2005, 01:32 AM
You cannot compare and apple to a pear these languages have two different purposes.

What do you want to be able to do? Have you got something you would like to create?

If your just wanting learn about programming or make something relatively simple with not too much effort Python would be best. If your willing to take a long time to learn a language with very little to see than C++ maybe the way to go.

But this does depend on what you want to achieve

liorean
11-02-2005, 02:02 AM
They are totally different animals. Python is a slow, interpreted but VERY powerful (as in able to do much with little fuss) language. One of the language that put the "high" in high level.

C++ on the other hand is - while not quite as low level as C - fast, compiled, but not especially powerful (you need much code to do small things).




Learning the Python language will be a far faster deal than learning the C++ language. Why? Because with C++ you will spend more time writing code, compiling and debugging than thinking about how to solve a problem. With Python, you need to write far less code to do the same thing, you don't need to re-compile every time you are debugging, you have much stronger runtime interspection facilities.

Which means that with Python, you'll spend more time learning the language and less time trying to wrestle the language into doing something sensible.

ubik
11-02-2005, 09:44 AM
thanks for the input, The reason i stopped reading the python book i have is when i got to the geometry capabilities of the language it really discouraged me at the time because i wasnt too familiar with the math at then, but not anymore, but also i stopped reading up when i read somewhere else that python cannot be compiled into an executable... is this true?

gsoft
11-02-2005, 10:23 AM
Well liorean has already pointed it out, Python is an interpreted language meaning that the Python Engine is required to be installed on the users machine now majority of Linux Distros have it installed or allow it to be installed, Windows not so much so. Now although by default Python is not a compiled language and hence does not offer you to have a binary, you can get 3rd party applications which will do this. The main reason is that the Python Engine is usually in the binary itself so no need for the user to install it.

On the other hand C++ is a compiled language so will compile the source into a binary which can be executed on a users machine depending on the platform.

Now both languages have there drawbacks, being an interpretted language (such as Python) you can use the same code on any machine as long as they have the interpretting Engine (Python in this case) installed. While with a compiled language you can compile on say windows and will more than likely require changes to the source to work in Linux, of course even if you did the most simplist thing to work in Linux will require that the source be re-compiled in Linux.

I hope this sheds some light on the matter.