John Porter wrote:
> > $mySite = http://www.foo.bar/text.html;
> Vs.
> $mySite = new URL 'http://www.foo.bar/text.html';
>
> I am far from convinced.
Simon Coxens wrote
> A language that doesn't have everything is actually easier to program
> in than some that do.
> -- Dennis M. Ritchie
The obvious reply is: "There's more than one way to do it"
I have to agree that there's not a huge diference between the two
ways of calling a constructor. I suppose the important thing is the
distinction between class and type.
In the latter case, I explicitly say "make be an object of class 'URL':
use the constructor named 'new' with these args". The the implicit form,
you are simply using 'http:...' as a factory that creates an object of a
class that conforms to the expected type. I'm sure you don't want to
write "$a = new Integer '32'". Sometimes there is value in omitting
trivial syntactic details.
A related question is why we want to tie objects. Afterall, you can use
methods on an object without ever tying it!
Dave.
--
Dave Whipp, Senior Verification Engineer,
Fast-Chip inc., 950 Kifer Rd, Sunnyvale, CA. 94086
tel: 408 523 8071; http://www.fast-chip.com
Opinions my own; statements of fact may be in error.