about sort and dictionary

Magnus Lycka lycka at carmen.se
Wed Nov 23 08:44:49 EST 2005


rurpy at yahoo.com wrote:
> a reminder" that the change is inplace.  How arrogant!  While
> I'm sure the designers had kindly intentions. my memory, though
> bad, is not that bad, and I object to being forced to write code
> that is more clunky than need be, because the designers thought
> they needed to help me with my memory.

Such as being arm-twisted into writing horrible things
like x = sorted(l) instead of x = l.sort()? It sounds a
bit as if someone locked you into a cellar and forced
you to program Python, just to torture you. I guess the
next step will be the comfy armchair! ;)

Python has its roots in ABC, a language intended for
teaching programming to beginners, and it goes to great
lengths to make it easy to do things right. In my opinion,
it also avoids the mistake of introducing hurdles in a
vain attempts to prevent programmer mistakes. Such hurdles
typically lead to ugly workarounds. There are a few cases
when things don't work as some people would expect them
to work, but I think there are good resons for that.

I'm surprised that you don't complain about not being able
to do "while x = f(): ..." while you're at it. That's also
a restriction of the kind you seem to rebel against.

I'm pretty sure Guido didn't think a bit about *your*
memory capacity when he designed Python, but rather wanted
to avoid spending his and other programmers' time on helping
people with yet another set of silly bugs.

> There is much about Perl's rich functionality that is very worthy.
> Unfortunately, as you know, it's syntax leaves a lot to be desired.

Which is mainly a consequence of TMTOWTDI...

If you want something more perlish, but with somewhat more
sane syntax, you might want to try Ruby.





More information about the Python-list mailing list