in reply to Re: new() function: incorrect?
in thread new() function: incorrect?
I guess my reasoning behind this is that you should always be clear on creating a new instance of an object. I can't think of too many instances where I'd domy $objectBlah = Blah::Object->new();
...that just wouldn't, generally, cut the mustard with me -- unless you *really* needed another instance of the same object to do other stuff with. As I write this, I was trying to think of when I've needed to do this exact thing, and I honestly can't think of any instances that I've done that.my $foo = $bar->new();
I can't think of an exact reason -- probably just that I think that perl's syntax is nearly always based around using something like (in the case of reading a constant item that you've set up in your object framework) :-my $foo = new Bob::Object;
Adding in something like this:my $constantStuff = Bob::Constants::CONSTANT_STUFF;
...just doesn't fit (in my head at least) with the nice perl way of doing things.my $bob = new Bob::Object;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: new() function: incorrect?
by gone2015 (Deacon) on Nov 12, 2008 at 15:38 UTC | |
|
Re^3: new() function: incorrect?
by lukeyboy1 (Beadle) on Nov 12, 2008 at 15:02 UTC |