I'm in complete agreement with the "one way in/out" (OWI-OWO ) rule. Out of interest, I have searched the net and of the many articles I found which cited OWI-OWO, all cited it in the scope of being good practice. I found one which cites "one way in, multiple|many ways out" with a scathing comment.
And on the subject of Exceptions, not all but arguably the best of the language compilers which implement them ensure the exception clauses are handled correctly. They enforce certain coding standards and style. MV Basic does not do anything like this and so can lead to all sorts of garbage interpretations of an exception. In the example, I'd have been inclined to have compounded the tests into a single (postive) clause: IF (A = B and C = D and E = F) THEN *; update record A single IF statement makes it damn obvious what you're testing. If it's too long a line then break the individual tests up into multiple shorter Boolean variables which can be put in a single IF statement. By the way, doesn't anyone use a READU before updating a record? Cheers, Stuart Boydell >-----Original Message----- >My view on code structure is very simple: >One way in, one way out. Any block of code, no exceptions. Deal with it. > >I understand the point about deep indentations making code unreadable - >especially in the ubiquitous line editors that some people still insist on >using - but you can still code single entry/single exit point without >nesting anything especially deeply. That's what GOSUB and CALL are for. > >The poster who talked here about modern languages encouraging the throwing >of exceptions, and suggested that multiple exit point code in BASIC emulated >this missed the point that those languages provide exception handling >mechanisms such that you can always engineer a single exit point for each >block, and if you don't, then the language effectively creates one - perhaps >slightly further away - for you. MV BASIC on the other hand provides >absolutely no exception handling other than what is explicitly coded. ********************************************************************** This email message and any files transmitted with it are confidential and intended solely for the use of addressed recipient(s). If you have received this communication in error, please reply to this e-mail to notify the sender of its incorrect delivery and then delete it and your reply. It is your responsibility to check this email and any attachments for viruses and defects before opening or sending them on. Spotless collects information about you to provide and market our services. For information about use, disclosure and access, see our privacy policy at http://www.spotless.com.au Please consider our environment before printing this email. ********************************************************************** ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/