[E-Lang] newbie syntax: picayune points from a prejudiced programmer
Ben Laurie
ben@algroup.co.uk
Thu, 01 Mar 2001 11:34:04 +0000
zooko@zooko.com wrote:
> * "The reason functions require parentheses is explained later in this
> chapter."
>
> Don't bother. I don't want to know the underlying design decisions.
> All functions should be invoked as `barf()' because that is how C,
> Java, Perl and Python do it.
Oh no it isn't! Brackets are optional in Perl (even if you have
arguments). This is not a good thing, IMO, not least because operator
precedence can bite you, e.g.:
open F,'somefile' || die "Can't open somefile";
will not die if the open fails, whereas:
open F,'somefile' or die "Can't open somefile";
or:
open(F,'somefile') || die "Can't open somefile";
will.
WTF anyone thinks this is a good idea is beyond me.
> Oh wait a sec!
>
> * "A parameterless function must have an open/close paren pair. Calls
> to parameterless functions must also include the parens. This
> contrasts with parameterless methods for objects described later,
> which do not require empty parentheses either during definition or
> when called."
>
> Ugh. I wish that functions and methods looked identical except for
> the presence of the object, and I wish that `()' were required on the
> end of every single invokation, so that I can scan a page of text and
> see the `(.*)' patterns and know where the invokations are.
Yes!
Cheers,
Ben.
--
http://www.apache-ssl.org/ben.html
"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff
ApacheCon 2001! http://ApacheCon.com/