Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return 2 values from a function
Message
From
16/10/2008 16:44:57
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
16/10/2008 12:45:09
John Baird
Coatesville, Pennsylvania, 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:
01355484
Views:
24
>>>I also agree. Having multiple exit points is confusing and is a bad programming practice according to every programming class I have had in college.
>>
>>Then I would disagree with all those classes you have had in college;)
>>
>>Cetin
>
>
>Post an example, please.
public bool SomeMethod() {
if ( FirstCheck() == false ) {  Messagebox.Show( "blah blah" );  return false; }
if ( SecondCheck() == false ) {  Messagebox.Show( "blah blah" );  return false; } 
// other code }
Imagine this code is in fact long. It would simply be inconvenient to have multiple if .. else. endifs and to read all the code to see what is returned from a code. I can easily say it returns immediately if FirstCheck() returns false.

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform