Python from Wise Guy's Viewpoint

Pettersen, Bjorn S BjornPettersen at fairisaac.com
Mon Oct 20 07:36:51 EDT 2003


> From: Alex Martelli [mailto:aleax at aleax.it] 
> 
> Hannu Kankaanp?? wrote:
> 
> > mike420 at ziplip.com wrote in message
> > news:<LVOAILABAJAFKMCPJ0F1IFP5N3JTNUL0EPMGKMDS at ziplip.com>...
> >> THE BAD:
> >> 
> >> 1. f(x,y,z) sucks. f x y z  would be much easier to type (see 
> >>    Haskell) 90% of the code is function applictions. Why not make 
> >>    it convenient?
> > 
> > Python has been designed to attract non-programmers as well. Don't
> > you think f(x,y,z) resembles the mathematical notation of passing
> > a function some parameters, instead of "f x y z"?
> 
> Yes -- which is exactly why many non-programmers would prefer the
> parentheses-less notation -- with more obvious names of course;-).
> E.g.:
> emitwarning URGENT "meltdown imminent!!!"
> DOES look nicer to non-programmers than
> emitwarning(URGENT, "meltdown imminent!!!")
> 
> Indeed, such languages as Visual Basic and Ruby do allow calling
> without parentheses, no doubt because of this "nice look" thing.
> 
> However, as I explained elsewhere, there are probably-insuperable
> language-design problems in merging "implicit call" and 
> first-classness
> of all names unless you basically go all the way following Haskell
> with implicit currying and non-strictness (and assignments should
> probably go away too, else how to distinguish between assigning to
> x a nullary function f itself, and assigning to x the result of
> _calling_ f without arguments...?).  Not to mention:
> 
> emitwarning URGENT highlight "meltdown imminent!!!"
> 
> where the need to disambiguate between highlight being the second
> of three parameters to emitwarning, or a function called with
> the string as its sole parameter and its RESULT being the second
> of two parameters to emitwarning, [...]

You could of course do it the Lisp way and quote the `'#',: out of
everything :-) [*sigh*, I promised myself I wouldn't contribute to the
Lisp/Python 'debate'...]

[..]
> My own reasons for the choice of Python over Ruby are quite
> nuanced and complicated, actually (those for either of them
> over Haskell have much to do with pragmatism over purity:-).
[..]

Mine are pretty simple, I couldn't stand looking at code calling method
'colour' when I was calling 'color' <wink>. (yes, I am kidding -- I own
the Pickaxe book and use Ruby for a number of things. I'm also not
pragmatic enough to choose not to use a language... ;/)

-- bjorn





More information about the Python-list mailing list