Why not use juxtaposition to indicate function application

Prasad, Ramit ramit.prasad at jpmorgan.com
Fri Mar 16 17:13:38 CET 2012


> >> I confess i've indulged in Haskell and found
> >>      f a
> >> more readable than
> >>      f(a)
> >
> > Hmmm... What about:
> >
> >      f a b
> >
> > versus
> >
> >      f(a(b))
> >
> > or was it supposed to be read as
> >
> >      f(a)(b)
> >
> >
> > or as
> >
> >     f(a, b)
> >
> > ?-)
> 
> That would be
>    f (a b)          # Haskell
>    f(a(b))          # Python

I have not used Haskell so far, but in this case I think I prefer the
'Explicit is better than implicit.'

I would probably always forget if it should be 

f a b 

or

f ( a b )

Not to mention the first line look like text rather than a function call
because my mind tends to filter out whitespaces like that when reading.
I blame variable width fonts (and the mind being a strange thing).


Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  



More information about the Python-list mailing list