Re: ->new (was Re: IO::Socket::INET)
chip@atlantic.net
Tue, 27 Jan 1998 23:37:03 -0500 (EST)
According to Tom Christiansen:
> > As well, C++ and Java require you to use new().
>
> That's a good reason not to. Perl's constructors are very
> different. They don't call overridden versions. They have
> to allocate memory. etc. Better not to deceive.
Deception/truth is not the relevant scale. Familiarity/novelty is.
Should Larry have required use of a newly invented "add" operator
because "+" doesn't quite work the same as C's (or Fortran's or PL/I's
or ...)? Of course not. Perl's "+" isn't exactly like any other
language's "+", but it's close enough for government work.
Likewise, that the intent and basic operation of "Class->new()" is
immediately recognizable is a feature, not a bug.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"It's the lemon zester of death!!" // MST3K