Allow multiline conditions and the like

Mark Wooding mdw at distorted.org.uk
Thu Nov 4 19:09:47 CET 2010


Chris Rebert <clp2 at rebertia.com> writes:

> Or, if possible, refactor the conditional into a function (call) so
> it's no longer multiline in the first place.

No!  This /increases/ cognitive load for readers, because they have to
deal with the indirection through the name.  If you actually use the
function multiple times, the mental overhead of forming the abstraction
and associating it with the function name is shared across the various
call sites and it's probably worth it.  If it's only called once, leave
it inline.

-- [mdw]



More information about the Python-list mailing list