You are viewing a single comment's thread from:

RE: Top 5 Reasons to use Python

in #technology7 years ago

You hit some good points, but missed something pretty important, depending on what you're developing: speed. Python is excellent, but it's much much slower than c/c++.

This won't matter for most programs, but if you're coding anything that does heavy lifting, c/c++ might be preferred, even though I'll be a pain to do.

Not like that will matter as much as personal computers get faster, though.

Sort:  

Yes I agree Python is slower natively, but there are some packages that make it more efficient. For example I am now using the NUMPY package by default for array manipulation.

I have tested it, the NUMPY package is about 60% faster than the default array structure. So that helps.

There are also tricks to speed up the code, for example in Python3 you don't need to transform a variable to float, you just declare it like this variable=1.0 so that is automatically a float.

I have found that if you transform a variable into a float with float(x) command it might make it 50% slower.

I am doing research now with an intensive script I wrote, so believe me every bit of efficiency helps, but I guess I should try it in C too to see whether it will speed it up even more.