Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return 2 values from a function
Message
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:
01355501
Views:
22
Very nice. I like this function. But should not it be named SomeFunction instead? Method has to do something.

>
>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.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform