Python

Hello.
I am a c++ programmer and I want to learn python.
Which one is better (c++ or python) ?
What's difference between them ?
Which is easier to learn till becoming expert ?
Thanks :)
I get the feeling that Python is the easier of the two languages to learn and to code smaller programs in, however it's invariably going to be slower, and possibly less intuitive harder to use efficiently for larger projects (though I have attempted so far not one large project in Python).

-Albatross
Last edited on
Which one is better (c++ or python) ?
Depends on what you want to do, as with everything else.

What's difference between them ?
It's quicker to name what they have in common: They are both object oriented. That's about all I can think of.

Which is easier to learn till becoming expert ?
Python.

and possibly less intuitive for larger projects.
What do you mean?
Aaah... *above post edited for correctness*

-Albatross
Well, that's rather redundant. Python is efficient at neither small nor large scale. It's not designed to be, it's designed for rapid development.
I said "use efficiently", and made no reference to the efficiency of the programs generated, unless you meant that you don't think Python is a language in which one can write efficiently?

-Albatross
Obviously. You can't write efficiently in an inefficient language (but, paradoxically, you can write inefficiently in any language). What I mean is, you can only optimize so much before you hit the limits imposed by the execution environment. For example, in C you might get rid of floating point operations inside a fast loop by using fixed point arithmetic. In Python, that optimization would make no sense because ultimately the real bottleneck is the environment. In Python, optimizations revolve around algorithms (e.g. use quick sort instead of bubble sort, or simply a map) and delegation (instead of writing your own "optimized" implementation of whatever that would be interpreted at run time, use the one the language provides, which will be native code). When you need to write something fast for which there isn't an implementation, you'll just write it in C and call it from Python.
Hmm... obviously we don't translate the expression "to write efficiently" in reference to a programming language the same way. I meant efficiently in terms of the development speed of a program (which you mentioned by mentioning Python's optimization for rapid development), while you meant efficiently in terms of the execution time of the program. I'll note that.

Aside from that misunderstanding, we seem to be on the same page.

-Albatross
Last edited on
Oh, I see it now. I held on to the second usage of "efficiently": "write efficiently [in it]". The first usage, "use [it] efficiently", can indeed be interpreted as development speed.
I just learned a little.
it is very tumultuous. C++ is very ordered.
I even don't know how it's programs start !!!
there is no even variable declaration !!!
I used Python to teach me how to use classes.
That's a word I never thought I'd see applied to a language. "Tumultuous".
That... can't be good for the language.

Here is a comparison: (NOTE: Requires comprehension of box plots):
http://page.mi.fu-berlin.de/prechelt/Biblio//jccpprt_computer2000.pdf

Here is an easier to understand comparison (however, it's probably biased):
http://www.python.org/doc/essays/comparisons.html

-Albatross
Topic archived. No new replies allowed.