very good reasons?
Samuel A. Falvo II
kc5tja at garnet.armored.net
Thu Oct 12 17:31:44 EDT 2000
On 29 Sep 2000 18:48:09 -0500, Glyph Lefkowitz wrote:
>"Explicit is better than implicit."
>
>If you say "sorted = arr.sort(); foo(sorted)", you're only implying
>that arr changed, whereas if you say "arr.sort(); foo(arr)" you're
>stating it explicitly.
This is why I like the Smalltalk-ish convention over some of the things that
Python does. In my ideal system, I'd use:
sorted = array.inAscendingOrder(); foo( sorted )
or:
sorted = array.inSortedOrderBy( compare_function ); foo( sorted )
This, to me, makes much more sense and is more explicit. This disadvantage
is that this consumes more memory in the process.
--
KC5TJA/6, DM13, QRP-L #1447 | Official Channel Saint, *Team Amiga*
Samuel A. Falvo II |
Oceanside, CA |
More information about the Python-list
mailing list