Defending the ternary operator
Anthony Baxter
anthony at interlink.com.au
Sat Feb 8 10:39:17 EST 2003
>>> Andrew Koenig wrote
> The essence of Laura's argument, I think, is that many programmers
> will not become familiary with if-expressions, as they're used only
> from time to time, which means that when they do encounter them,
> it will be a mental stumbling block.
There's also the point that "if" already has existing meanings. This
means that it's use in this rare form (at least, I'd hope it's rare;
if a piece of code features a large number of ternary expressions,
I'd question the sanity of the author), it will confuse the reader
even more.
Anthony
More information about the Python-list
mailing list