Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return 2 values from a function
Message
 
To
16/10/2008 17:15:04
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01355203
Message ID:
01355500
Views:
24
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform