for -- else: what was the motivation?

MRAB python at mrabarnett.plus.com
Sun Oct 9 20:47:34 EDT 2022


On 2022-10-10 00:40, dn wrote:
> On Sun, 9 Oct 2022 at 15:39, Axy via Python-list
> <python-list at python.org> wrote:
> 
>> "shortest block first"
> 
> Have never heard this advice before. Kind-of rankled with me, as it did
> for others.
> 
> Enquiring minds want to know... Played Duck, duck, go on this: zero hits
> amongst a pile of similar phrases - turns-out there's an algorithm with
> a similar name, but not related, and an electronics approach (way too
> 'low' a level for translation to us though).
> 
> Tried prefixing with "program" but no such advice to programmers or
> program[me] designers.
> 
> Tried prefixing with "python", but equal lack of joy.
> 
> Would OP please quote source?
> 
[snip]
After a few minutes searching I found this:

https://docs.typo3.org/m/typo3/reference-coreapi/9.5/en-us/CodingGuidelines/CglPhp/PhpFileFormatting/PhpSyntaxFormatting.html

"""It is recommended to create conditions so that the shortest block of 
code goes first."""


More information about the Python-list mailing list