Tom Ritchford
1 min readSep 18, 2022

--

I disagree almost completely. The very reason that Python has dominated much "faster" languages for over a decade now is that for most programmers, speed is not particularly important - what's important is our human time, which is all we have.

We have a slow script that does some housekeeping and it takes a minute to run - we run it every few weeks. I mentioned to an intern that it was dog-slow and it would be ten times as fast if we rewrote it in numpy or C++. He asked why we didn't do that, and I said because it would take days of my life, and speed up a script we run once every two weeks from 60 seconds to 6 seconds - time I just never notice.

If you are doing something computationally intensive there are packages like numpy and pytorch that as fast as C++.

Or in the very worst case, you write your initial code in Python, find out the bottlenecks which are inevitably a tiny portion of the code, and then optimize just that into C or C++. Python interoperates extremely well with those languages.

But I personally did that once for fun, but I have never had to do it, in almost 20 years of Python programming.

The reason that Python got to be 30 before the started to optimize for speed is because it was literally at the bottom of the list of what people were asking for.

--

--

Responses (1)