Because having to change the syntax is *one more thing* to worry about
when you change a variable name, or change a parameter. Because
forgetting to change the syntax is *one more thing* to go wrong. This
makes this proposed feature *more* fragile rather than less, and I don't
think we should be adding syntax that encourages fragile code for
marginal benefit, particularly when the proposal goes against two of the
Zen and, frankly, has nothing much going for it except a little less
typing in a fraction of all function calls.
It doesn't make code more readable, except in the sense that there's
less to read. If anything, it's *less* readable because it looks like
you've forgotten the parameter name:
It's less explicit.
It priviledges a special case that really isn't that
important. Out of the infinite number of possible combinations of
parameter=expression, what's so special about the one where the
expression happens to be precisely the same string as the parameter?
Even if it is special, it's not special *enough* to justify special
syntax.
Either I'm not explaining myself, or you're not understanding me. Let me
give you some examples.
The point isn't that it's hard to make that edit. The point is that I
shouldn't need to make that edit.
I'm sorry if it annoys you to be told that your understanding of Don't
Repeat Yourself is mistaken, but it is. It is not "any repetition of
code is a bad thing".
> and going by the principles advocated there, if you change theThe called function may be called from a thousand places. Do you really
> name of the parameter in the called function, you *should*
> change the corresponding parameter of your function to match,
> for the sake of consistency.
think that because I decide I don't like my local variable to be called
(say) "first_name", and want to call it "personal_name" instead, that I
"should" force every other caller to change their local variable too,
"for the sake of consistency"?