The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

alister alister.ware at ntlworld.com
Thu Mar 24 14:30:59 EDT 2016


On Thu, 24 Mar 2016 14:28:32 +0000, BartC wrote:

> On 24/03/2016 14:01, Chris Angelico wrote:
> 
>> I don't, until it's pointed out. At that point, someone who respects
>> the language will at least pay *some* heed to the changed
>> recommendations; what we're seeing here is that he continues to use C
>> idioms and then complain that Python is slow. I don't expect him to
>> magically know what Python idioms are, but when the thread has gone on
>> this long and he's still showing the same style of code, that's when I
>> start to agree with Ben that he's not paying heed to Pythonic vs
>> non-Pythonic.
> 
> Have a look at the short thread 'Rotation' in comp.programming starting
> 4-Jan-2016.
> 
> (Possible link:
> https://groups.google.com/forum/#!searchin/comp.programming/rotation/
comp.programming/aQh4n2HGtaU/sSbcyjqfEQAJ)
> 
> Someone posts an algorithm in C++, I post a version in my language,
> someone else calls that a 'blub' solution and offers a much shorter
> version in /their/ language.
> 
> I point out that their solution just uses a built-in to do the work. It
> by-passes the question of the algorithm, which was the point of the
> thread. I also point out that I also gave a one-line version in my
> language.
> 
> What you're trying to say I guess is that such a one-liner would be
> Pythonic. And what I'm saying is that that would defeat the object of
> what I'm trying to do.

if you're trying to demonstrate the deficiency of one algorithm over 
another then you should be testing them in the same language.

If you are trying to compare one language to another then the task should 
be written in the most efficient means for then language.
language "A" has a builtin function "X" where as language "B" does not, 
that just shows that "A" is better suited to the task than "B", "B" 
probably has other areas where "A" is not so good.

otherwise why not wright in assembler/machine code which has to be the 
most efficient language (because all the others eventually fall back to 
executing these processor instructions anyway




-- 
We're constantly being bombarded by insulting and humiliating music, which
people are making for you the way they make those Wonder Bread products.
Just as food can be bad for your system, music can be bad for your 
spirtual
and emotional feelings.  It might taste good or clever, but in the long 
run,
it's not going to do anything for you.
		-- Bob Dylan, "LA Times", September 5, 1984



More information about the Python-list mailing list