[Python-il] [pyweb-il:1072] Python coding question
aronovitch at gmail.com
Wed Jul 7 18:39:25 IDT 2010
On Wed, Jul 7, 2010 at 5:56 PM, Arik Baratz
<list+python at arik.baratz.org<list%2Bpython at arik.baratz.org>
> On 8 July 2010 00:38, Dov Grobgeld <dov.grobgeld at gmail.com> wrote:
>> The thing is that making single characters for all operators would make
>> the program look more compact. The learning curve might be slightly higher
>> (including learning how to use the keyboard), but most people spend much
>> more time using a computer language than learning the language. So it is
>> worth creating something which has that kind of beauty to it.
>> Thinking about it, it would be easy to a language "Punithon" as a
>> preprocessor that would implement such a syntax and output python. But
>> again, I dare anyone to be crazy enough to do it. :-)
> "Readability counts"
> - Tim Peters, The Zen of Python (a.k.a. import this)
> One of the things I like about Python is that I can give my smart but
> non-programmer friends a piece of Python code, and they can read it,
> understand it AND SUCCESSFULLY MODIFY said piece of code (within reason). If
> I give the piece of code to a non-Python programmer friend, they can do all
> the above and successfully modify it way beyond reason (not always a good
> thing) and add to it.
> I don't think that "compactness" beats readability. I'm happy to type f-o-r
> instead of shift-meta-a or whatever other combo produces the ∀ character.
> As for the assignment / binding operator... well it's not the best one, but
> it doesn't have the potential to cause as much trouble as in C, where
> if(a=b); is a valid statement.
I was not complaining about what it does.
Only about the choice of symbol (too many people come from Java and C).
Many questions on mailing lists are caused by this (Maybe <- or := would
have been a little better). Introducing += made the problem even worse.
For example, too many people are trying to find magic-methods to overload
'the operator =', when in fact it has nothing to do with the object on the
RHS (only manipulates the local namespace).
Some examples for common bugs caused by this (hebrew):
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-il