N
Neil Cerutti
This can be good and can be bad. It's good when it aids
readability; it's bad when you need to pass practically the
entire locals() as function arguments and/or return values.
Even when lots of context is needed, defining the context with
function calls is a big improvement over directly using names in
a module's global namespace.
Sometimes repeatedly reused context suggests that creating new
classes of objects might be a good idea.
I would split the function only when both halves (caller and
callee) can be given short and useful names - if you can't
explain what a block of code does in a few words, it's probably
a poor choice for splitting out into a function.
I agree, except for the implied unconditional preference for
short names. I believe the length of a name should usually be
proportional to the scope of the object it represents.
In my house, I'm dad. In my chorus, I'm Neil. In town I'm Neil
Cerutti, and in the global scope I have to use a meaningless
unique identifier. Hopefully no Python namespace ever gets that
big.