Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiple return points - is it OK practice?
Message
 
 
À
01/02/2013 15:39:55
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01564936
Message ID:
01564958
Vues:
45
>I have controller methods where sometimes I return a View and othertimes I RedirectToAction. So, two returns are required.
>
Right now I am working on the conversion of our VFP class library into C# dll. In VFP we checked parameters at the top and returned. There were also many other return exists in the methods.

I already converted a few by not using early returns, but I think in general it should be OK - otherwise it's very hard to use if else if else nested logic.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform