Encapsulation, inheritance and polymorphism

Mark Lawrence breamoreboy at yahoo.co.uk
Sun Aug 19 04:55:18 EDT 2012


On 19/08/2012 06:21, Robert Miles wrote:
> On 7/23/2012 11:18 AM, Albert van der Horst wrote:
>> In article <5006b48a$0$29978$c3e8da3$5496439d at news.astraweb.com>,
>> Steven D'Aprano  <steve+comp.lang.python at pearwood.info> wrote:
>> <SNIP.
>>> Even with a break, why bother continuing through the body of the
>>> function
>>> when you already have the result? When your calculation is done, it's
>>> done, just return for goodness sake. You wouldn't write a search that
>>> keeps going after you've found the value that you want, out of some
>>> misplaced sense that you have to look at every value. Why write code
>>> with
>>> unnecessary guard values and temporary variables out of a misplaced
>>> sense
>>> that functions must only have one exit?
>>
>> Example from recipee's:
>>
>> Stirr until the egg white is stiff.
>>
>> Alternative:
>> Stirr egg white for half an hour,
>> but if the egg white is stiff keep your spoon still.
>>
>> (Cooking is not my field of expertise, so the wording may
>> not be quite appropriate. )
>>
>>> --
>>> Steven
>>
>> Groetjes Albert
>
> Note that you forgot applying enough heat to do the cooking.
>
>

Surely the first check is your filing system to make sure that you've 
paid the utilties bills so you've got gas and or electricity to apply 
the heat.  Either that or you hire Ray Mears to produce the spark needed 
to light the fire :)

-- 
Cheers.

Mark Lawrence.




More information about the Python-list mailing list