Kelly Cookson wrote:
When I write a PHP function, I can make up a return variable name on the fly, and it doesn't matter if I'm returning characters, numbers, or arrays. I can also change the type of data the function returns without having to change the variable definitions everywhere the function is called. Similarly, when I call a PHP function, I can make up a variable name on the fly to receive the output, and it doesn't matter what kind of output is being passed back.
But, if you want to call it laziness, guilty as charged. ;-)
Not laziness. Bad design. That may sound harsh, but if you find yourself regularly changing the return value of a function, then you haven't designed the application very well. Changing what a function returns isn't something simple - it will affect every place that function is called. If the calling code expects the function to return a Customer object and you've changed the function to return a date, is it going to work?

It's the same issue I have with folks who insist they need to make database changes often. That just tells me they haven't designed their database very well. Better up-front analysis leads to less back-end changes.

Joe

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.