|
Posted by Chuck on July 18, 2008, 9:49 pm
Please log in for more thread options
> burgermeister01@gmail.com wrote:
>> Default Arguments: what's the general consensus about them? To give an
>> example, so we're all on the same page, this is the syntax I'm talking
>> about:
>>
>> function foo($bar = "some value"){
>> }
>>
>>
>> So, in the past when I was programming with PHP a lot, I found myself
>> using default arguments more and more because they were so convenient.
>> But in the back of my mind, something about them seemed
>> somewhat...sloppy. I've never had the privilege of working on a
>> project quite large enough for architectural weaknesses to really show
>> their strain, so I'd like to pose this question to other minds, to see
>> if any of you have input about this syntactical tool.
>>
>> Thanks!
>>
>
> I think default arguments are fine if you have a specific default argument
> to pass. It just helps keep the code cleaner.
I just wish php supported named arguments too.
|