Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is Method Overloading a good or bad thing?
Message
De
06/07/2004 15:21:57
 
 
À
01/07/2004 16:52:06
Anthony Testi
Fabtrol Systems Inc.
Eugene, Oregon, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00919869
Message ID:
00921139
Vues:
20
SET RANT ON

Bully for Bertrand Meyer! I firmly believe that method overloading is the single biggest disservice ever done to the programming community by the developers of VS.Net (and yes, I realize they didn't come up with it on their own). Why? For one reason: CLARITY. I can easily picture a careless developer proudly coming up with a single monstrous class with heavily overloaded methods to do everything in an application!

Every piece of code you write should be your last. It should be short, efficient, and easy to explain, either to the client that has to maintain it, or the developer that picks up the pieces after you step in front of a bus tomorrow. That's a pretty cynical view of the world, I realize, but I have been involved in too many projects that had flimsy specs, non-existant documentation, poor code comments, flawed logic, and/or too fingers in the code over the life of the project to believe otherwise. I'm sure everyone here has had to review thousands of lines of code in short periods of time, desperately trying to find the one flaw that is keeping something from working. Overloaded methods would simply make that process that much more difficult. Exponentially difficult, IMHO.

Theoretically, in a properly designed and rigoursly managed application, overloading MIGHT save some extra lines of code by consolidating similar funcionality into one method. But, it is so easy to implement incorrectly that it should NEVER be allowed. NO ONE that I've discussed REAL-WORLD development with has ever been able to convince me otherwise. OOP is hard enough to do properly for most developers without that red herring!

SET RANT OFF
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform