OT: why do people use python when it is slow?

David DeWitt via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Oct 14 08:49:18 PDT 2015


On Wednesday, 14 October 2015 at 15:31:49 UTC, John Colvin wrote:
> On Wednesday, 14 October 2015 at 15:25:22 UTC, David DeWitt 
> wrote:
>> On Wednesday, 14 October 2015 at 14:48:22 UTC, John Colvin 
>> wrote:
>>> On Wednesday, 14 October 2015 at 14:32:00 UTC, jmh530 wrote:
>>>> On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc 
>>>> wrote:
>>>>> https://www.quora.com/Why-is-Python-so-popular-despite-being-so-slow
>>>>> Andrei suggested posting more widely.
>>>>
>>>> I was just writing some R code yesterday after playing 
>>>> around with D for a couple weeks. I accomplished more in an 
>>>> afternoon of R coding than I think I had in like a month's 
>>>> worth of playing around with D. The same is true for python.
>>>
>>> As someone who uses both D and Python every day, I find that 
>>> - once you are proficient in both - initial productivity is 
>>> higher in Python and then D starts to overtake as a project 
>>> gets larger and/or has stricter requirements. I hope never to 
>>> have to write anything longer than a thousand lines in Python 
>>> ever again.
>>
>> That's true until you need to connect to other systems.  There 
>> are countless clients built for other systems thats are used 
>> in real world applications.  With web development the Python 
>> code really just becomes glue nowadays and api's.  I 
>> understand D is faster until you have to build the clients for 
>> systems to connect.  We have an application that uses 
>> Postgres, ElasticSearch, Kafka, Redis, etc. This is plenty 
>> fast and the productivity of Python is more than D as the 
>> clients for Elasticsearch, Postgres and various other systems 
>> are unavailable or incomplete.  Sure D is faster but when you 
>> have other real world systems to connect to and time 
>> constraints on projects how can D be more productive or 
>> faster?  Our python code essentially becomes the API and usage 
>> of clients to other systems which handle a majority of the 
>> hardcore processing.  Once D gets established with those 
>> clients and they are battle tested then I will agree.  To me 
>> productivity is more than the language itself but also 
>> building real world applications in a reasonable time-frame.  
>> D will get there but is nowhere near where Python is.
>
> Python is inherently quite good for glue and has great library 
> support, so if that's the majority of your work then Python is 
> a good choice. On the other hand, there's plenty of programming 
> out there that isn't like that.

I agree but the quora question ask why it is popular despite 
being slow and this is the reason.  If you are doing tasks that 
are computationally expensive in Python then yes it will be slow 
but Python is popular largely because of their web frameworks and 
support.  Even something like Pandas is good enough for most 
peoples data sets.  But still I think most people use it as glue 
and if they need something done they can pass it off to something 
else to do the "real" work.  If this wasn't the case then Python 
would not be as popular.  You pick the right tool for the right 
job maybe D and maybe Python and this doesn't mean your results 
will be slow.


More information about the Digitalmars-d-learn mailing list