Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return 2 values from a function
Message
 
À
16/10/2008 17:15:04
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01355203
Message ID:
01355500
Vues:
22
Function SomeMethod() as Boolean
  return false
endfunc
Is easier to read, easier to maintain, is even shorter and has the same result as yours {BG}, sorry, could not resist.

>
>Function SomeMethod() AS Boolean
>
>   Dim result as Boolean = False
>
>   If FirstCheck() = False Then
>      result = False
>   ElseIf SecondCheck() = False Then
>      result = False
>    Else
>        'Other code here
>   EndIf
>
>   Return result
>      
>End Function
>
>
>I would argue that my code is easier to follow and would be easier to maintain, even if it is a bit longer.
"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