Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return 2 values from a function
Message
From
22/10/2008 02:38:17
 
 
To
22/10/2008 02:12:49
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
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:
01356207
Views:
35
>>Throughout my college been told that every function should have only one exit point and thats how I had to draw my logical schemas( fortran and pascal yeah!) but I have always favored early exit since it made the program easier to read.
>
>Exactly what I am saying. Colleges, books etc say 'one exit point'. OTOH real world developers' experience show that 'multiple exit point' is easier to read and maintain for some (if not many or all) developers.
>Cetin

I personally have found that most of the stuff they teach you at college is actually based on sound reasoning and experience. For example, whenever I veer from the single function exit -strategy I find that, more often than not, I end up introducing nasty, hard-to-debug bugs.

Readability shouldn't really be a problem if you follow the other cardinal rule of keeping our functions short and to the point.

These are but few of the cardinal rules of programming, just like always using surrogate keys is a cardinal rule of relational database design (I also had to learn this lesson the hard way many moons ago, and boy was that a painful -- and certainly unforgettable -- one to learn.)

You step off the Path of Cardinal Rules at your own peril, because when you do, you may well find yourself in a bewildering jungle without a good (single) exit strategy...

Pertti
Pertti Karjalainen
Product Manager
Northern Lights Software
Fairfax, CA USA
www.northernlightssoftware.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform