for -- else: what was the motivation?

Chris Angelico rosuav at gmail.com
Sun Oct 9 21:23:30 EDT 2022


On Mon, 10 Oct 2022 at 11:52, MRAB <python at mrabarnett.plus.com> wrote:
>
> 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."""

Which is more disparaging: "I couldn't find anyone suggesting this" or
"The only place I could find it was a PHP style guide"?

ChrisA


More information about the Python-list mailing list