in reply to Re: (Re:)+ Constructor/Factory Orthodoxy
in thread Constructor/Factory Orthodoxy

You are right that common usage in popular OO languages leans that way. As I stated I tend have that expectation myself. However:

Can an abstract class not have a constructor?

Should a subtype be able to be substituted for a supertype in any situation?

Should I be concerning myself with my object's concrete type on the typical constructor call?

When I consider these questions I wonder about the validity of my initial expectation.

It depends on what the meaning of the word 'isa' is.

Regarding:

my $frob = new Frob();
I have a greater expectation, in Perl, that Frob() is a routine call returning something here. That bothers me. This seems a very queer, obstrusive, distracting use of extraneous parentheses.

Replies are listed 'Best First'.
Re4: Constructor/Factory Orthodoxy
by dragonchild (Archbishop) on Feb 27, 2003 at 14:27 UTC
    That's because that should look like my $frob = Frob->new().

    (Before people flame me, Larry has said on many occasions that he wishes he had not introduced the indirect object syntax.)

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.