Defending the ternary operator

Laura Creighton lac at strakt.com
Sat Feb 8 10:54:36 EST 2003


> Laura> I don't think that the relationship is that simple.  Some
> Laura> things which are elegant are short.  Some things which are
> Laura> obscure are also short.  Persuing shortness alone is not the
> Laura> answer, or we would all be programming in APL.
> 
> If APL had not been so intransigent about avoiding control structures
> and abstract data types, I think it would be orders of magnitude more
> popular than it is today.
> 
> APL is a prime example of my claim that ease of comprehension is
> proportional to brevity * familiarity: APL programs tend to be
> extremely short, but because most of the functions are expressed as
> symbols that give outsiders no clue to their meanings, they are
> unreadable until you put in the effort to learn what the symbols mean.
> 
> Once you do know what they mean, APL programs are often much easier
> to understand than their counterparts in other languages.

Then you go away for six months and code in some other language.
And then you get a bug report. You look at your code and no longer
remember what the heck it was that you were trying to do.  

I think APL demonstrates that the goals of 'people who write code'
and the goals of 'people who read code' need not coincide.  Python
used to be heavily weighted in favour of those who read code.  Many
people I know thought that this was the best thing about Python. 

Laura 
> 
> -- 
> Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark
> -- 
> http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list