Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Re-factoring
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01577083
Message ID:
01577125
Vues:
51
>Also, as a general rule, try to avoid creating methods with lots of "ref" or "out" parameters. If you have more than one seriously consider introducing a simple class with the properties you need and return that instead. You'll then find that instead of having 5 local vars that you have to set-up, you just get back one object (and that helps to clean up the code).


I think that yours and Craig's advice(s) are great, the only thing I would say is that, for me, as a general rule, one "out" or "ref" parameters is one too many, is the exception that should scarcely be used, if at all for it means the method is doing at least two things (the other is the return that should be the only one used)
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform