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

Mark Lawrence breamoreboy at yahoo.co.uk
Mon Mar 14 13:17:57 EDT 2016


On 13/03/2016 20:12, Marko Rauhamaa wrote:
> BartC <bc at freeuk.com>:
>
>> Exactly why having ready-made solutions is preferable to everyone
>> hacking their own solutions to switch.
>
> A developer friend of mine once said insightfully that the point of OO
> is getting rid of switch statements. IOW, most use cases for switch
> statements are handled with virtual functions.
>
> The most significant exception in my experience is message decoding,
> where switches/ifs cannot be avoided.
>
>
> Marko
>

http://c2.com/cgi/wiki?SwitchStatementsSmell

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list