79 chars or more?

Neil Cerutti neilc at norwich.edu
Tue Aug 17 19:07:14 CEST 2010


On 2010-08-17, AK <andrei.avk at gmail.com> wrote:
> After all, I think it's a matter of balance between
> readability, expressiveness and succinctness. If I split a
> function in two, that still means that understanding the
> functionality of the code will require scrolling around and
> looking at the second function. I guess what I'm trying to say
> that we shouldn't just care about readability of lines but also
> readability of functions and blocks of functionality (that may
> include several functions that accomplish a single "task".)

When considering creating variables and functions, I try to use
the same rule of thumb: If I can come up with a good name for it
relatively quickly, then it probably deserves to exist. If all I
can think of is 'func' or 'x', then it's an artifact that I hope
to avoid.

Splitting a function in two need not obscure the meaning, and may
even improve it, *if* the names of the new functions are good.

-- 
Neil Cerutti



More information about the Python-list mailing list