r/learnpython • • Jun 28 '20

Can anyone explain why we use Python

I keep reading people say things like ‘because Python is built on C’ and ‘Python is much slower than C++ or Go’, ‘Thats why those languages are used to make most popular games’. I also see people refer to Python as a ‘machine’ language, etc etc. So... why use python then if you can do things faster with another language? And why is Python so popular if this is the case? Seems like python is easier to understand for me at least and much easier to read, but is there some other benefit I’m not understanding? Sorry if this had been asked before, I can’t find any direct comparison information between Python and other languages.

EDIT: Thanks everyone! I feel a much better understanding of why python is fast in a different way from other languages, saving programming time rather than computing time. Definitely got the answers I was looking for.

Another edit: Great insights all around. Thanks to everyone taking the time to answer! Looks like I need to do some more research on Cython as I see a few people mentioning it for when speed is required.

336 Upvotes

120 comments sorted by

View all comments

Show parent comments

75

u/saltyhasp Jun 28 '20

I would say the programmers time is often more important than execution speed... but this is not always the case. When it's not the case you write some or all of the code in another language.

0

u/[deleted] Jun 29 '20

[deleted]

4

u/ryrythe3rd Jun 29 '20

run code for literally a year or more of CPU time

Can you explain this? Do you mean by parallelizing computations?

12

u/[deleted] Jun 29 '20

Yes, the wall clock time is much less, because I run it in batches on a supercomputer. Usually on the order of 72 hours. But if you strung the simulations in a line it'd be that long.