I strongly dislike Python 3
Steven D'Aprano
steve-REMOVE-THIS at cybersource.com.au
Wed Jun 30 22:06:09 EDT 2010
On Wed, 30 Jun 2010 18:57:58 -0400, geremy condra wrote:
>>> Actually, I agree with this complaint though- it is much easier to
>>> type spaces than parens.
>>
>> Yes. And typing "p" is easier than typing "print". Perhaps we should
>> replace all Python built-ins with one letter names so that we can
>> *really* optimize our typing effort?
[...]
>> Perhaps not.
>>
>> The rule against premature optimization doesn't just apply to *code*.
>
> Hypocrite. You just took Jorgen Grahn to task in another thread for
> slaying exactly this kind of strawman. You're too smart to think that
> this is what I was advocating.
You're correct, I didn't think that's what *you* were advocating, and I'm
sorry if that's the impression I gave. I agreed with you that typing
"print space args" is easier than "print left-paren args right-parens",
but then took that micro-optimization to its (il)logical conclusion, and
demonstrated that trying to minimize typing effort is a mug's game. You
might call it a strawman, but I prefer to call it reductio ad absurdum.
(That's not to say that we should *maximize* typing either.)
Consistency, expressiveness, readability and re-usability are at least as
important as minimizing typing, and probably more so. The micro-cost of
typing print-as-a-function over print-as-a-statement is, I believe, far
outweighed by the other advantages.
But like all optimizations, measure measure measure. If it turns out that
adding parentheses to print really does add a significant drain on
programmer productivity, then removing them again would no longer be a
premature micro-optimization but an actual optimization.
But, honestly, is there anyone here, even the most heavy users of print,
who would seriously expect that adding parentheses to print calls will do
more than add a tiny fraction to the amount of typing effort already
required to use Python? I suppose in principle those extra three key
presses (shift-9 shift-0 vs space) could be the straw that breaks the
camel's back, but I doubt it.
--
Steven
More information about the Python-list
mailing list