in reply to OO style: Placement of "new"
However, the alternative just doesn't read as nicely:my $object = new Thingy; print $log "It works!\n" if $object->is_valid();
I do C++, but that's not why I prefer the "new class()" form. It just sounds more like the spoken word. Heck, if I were to slavishly follow C++ syntax, I'd never use the followup 'if' form.my $object = Thingy->new; if ($obj->is_valid()) { $log->print("It works!\n"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: OO style: Placement of "new"
by chromatic (Archbishop) on Apr 08, 2003 at 04:36 UTC |