Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel OLE Automation Server
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00302601
Message ID:
00304211
Views:
32
>IMHO, placing returns in the middle of code blocks can make for a lot of problems.

>I wonder what other's think?????

Ahhh yes, I've debated this myself many times. I had a structural programming Prof preach endlesslessly about a single point of return from any procedure. That habit was ingrained in my thick skull and I first balked in VFP when seeing multiple embedded Returns in method code. But then I inherited someone elses code, and had to fiddle my way through never ending methods and book length prg-based class definitions and came to appreciate the if I can't proceed, bail out now reasoning behind multiple and/or embedded Returns. So I came up with my own personal standards...

If it's not a class library, honor the wisdom of the age old habit of only a single point of return.

If it is method code in a class library, and it's anything longer than a screen full of code, implement no sense in going any farther, bail out now multiple returns.

One exception to the last point, if it's in any way/shape/form a transaction, you need to look at the entire transaction anyway to understand it so use only a single point of return.
Roxanne M. Seibert
Independent Consultant, VFP MCP

Code Monkey Like Fritos
Previous
Reply
Map
View

Click here to load this message in the networking platform