[E-Lang] down with `define' (was: newbie syntax: picayune points from a prejudiced programmer)

zooko@zooko.com zooko@zooko.com
Fri, 02 Mar 2001 10:01:31 -0800


 Tyler wrote:
> MarcS wrote:
> > We could also make "new" the secret shortcut method instead
> > of "run":
> >
> > class Thing() :any {
> >     def thing{}
> > }
> > def thing := Thing new()
> >
> > This looks positively Java-esque. It kinda makes me smile :-)
> 
> I'm finding it strange that you are so wed to the word "new".

...

> Zooko pointed out that Python also constructs new objects with
> "Thing()". So both C++ and Python use this syntax. It seems Java is
> the only place where you always use "new".


I'm trying to put aside my affection for Python and harken back to my
days as a C++ and Java coder, since my examination of sourceforge shows
that Python barely rates above "miscellaneous", definitely below PHP,
of which I know next to nothing, and far below C which dominates.


(Did you guys receive that message I sent about popularity of
programming languages on slashdot?  I didn't receive any replies.)


But anyway, I would consider:

>>> class Thing() :any {
>>>     def thing{}
>>> }
>>> def thing := Thing new()

to be "familiar", and also:

>>> class Thing() :any {
>>>     def thing{}
>>> }
>>> def thing := Thing()

or maybe 

>>> def thing := Thing init()

but I'm a little frightened by

>>> def thing := Thing run()

because what's this `run' thing?  I just wanted to create an object.
`run' sounds suspiciously like it is going to do something weird.  This
is an irrational fear, since I am perfectly comfortable with
constructors (named `Classname()' in C++ and Java and `__init__()' in
Python), but I still feel it.  Maybe it is because when I am reading
or calling someone else's code, I'm not sure if the `run()' thing does
what I expect -- initialize and object and give me a reference to it.



Regards,

Zooko