Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is Method Overloading a good or bad thing?
Message
From
06/07/2004 14:56:22
 
 
To
01/07/2004 17:51:31
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00919869
Message ID:
00921130
Views:
18
>I'm not sure I agree with him. IMO, there are times when overloading makes lots of sense. Take any function in VFP that has optional parameters. Without overloading you have two choices:
>
>1. Have a separate function that you have to call depending on the number of parameters.
>2. Always pass all parameters.
>
>In these cases, overloading makes sense.
>

The third option is to have the method supply default values for empty or missing parameters, much as is done in SQL. This is my preferred "style" if you will; see my rant above.
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform