[UPHPU] any asp converts?

Jon Jensen jjensen at debonairesolutions.com
Tue Nov 30 10:55:24 MST 2004


> > in PHP you can overload methods using argument lists, but 
> not in ASP.
> 
> Eh? Is this the dirty hack we talked about a few months back 
> where developers are encouraged to allow arbitrary arguments 
> to their functions, and then write if/else blocks to handle 
> different parameter sets? That is not overloading at the 
> language level, and I consider it downright harmful.
> 
> True overloading (from a real man's language like C or Java) 
> is very valuable.
> 

Good point. However, I think PHP's limited overload capabilities are better
than none at all. Personally I prefer the approach where you initialize
parameters with a default value if they aren't provided:

function foo( $val1, $val2 = 0 ) {
  //do something
}

This allows you to call the function with 1 or 2 parameters. If you only
provide $val1, $val2 will be initialized to 0.

Jon




More information about the UPHPU mailing list