Defending the ternary operator

Dave Brueck dave at pythonapocrypha.com
Sat Feb 8 19:58:51 CET 2003


On Sat, 8 Feb 2003, Laura Creighton wrote:

> Regardless of the reasons some people _want_  conditionals, people
> are going to _use_ them because they save keystrokes. The number of
> people who will do anything to save keystrokes is legion.

But how effectively can the language police peoples' laziness, and should
it? I mean, a lazy developer could just as easily save keystrokes by using
all one- and two-character variable names, indenting only a single space,
and not writing any comments. The same laziness (lack of discipline) will
manifest itself in a lack of architecture/design, lack of tests, etc.

Pair programming or code reviews or even some good old fashioned mentoring
is the place to encourage best practices and discourage bad ones - not the
language.

-Dave





More information about the Python-list mailing list