I hope you're joking - talk about making code unreadable, comments that
look like code are (IMO) a very BAD idea. The indentation level makes it
perfectly clear what goes with what, and if it doesn't then change the
structure of the code.

IMO
       IF XOOS.ALL.COURSES='Y' THEN

          some lines of code

       END ELSE ;* IF XOOS.ALL.COURSES='Y' THEN

          some lines of code

       END ;* IF XOOS.ALL.COURSES='Y' THEN

is much less clear than my preferred way of formatting the same
structure:

        IF XOOS.ALL.COURSES = "Y"
        THEN
             some lines of code
        END
        ELSE
             some lines of code
        END

I can easily see the start and end of both the THEN block and the ELSE
block and also easily see to which condition they belong.

The same structure can be used for ALL conditional statements and each
block is always easy to find and associate with it's starting statement,
eg:

        READU record FROM file,id
        ON ERROR
             statements
        END
        LOCKED
             statements
        END
        THEN
             statements
        END
        ELSE
             statements
        END


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, 28 September 2005 7:11 AM
To: [email protected]
Subject: Re: [U2] Good Programming Practice Question.........

> RETURN with a comment..........that is an excellent suggestion.

I'd argue that any END statement that's more than a handful (8-10) lines
from the opening IF (or whatever) statement should have a comment.

Here's an example (that's not long enough to satisfy my 'handful'
argument
above):

       IF XOOS.ALL.COURSES='Y' THEN

          some lines of code

       END ELSE ;* IF XOOS.ALL.COURSES='Y' THEN

          some lines of code

       END ;* IF XOOS.ALL.COURSES='Y' THEN

Jeff Butera, Ph.D.
Administrative Systems
Hampshire College
[EMAIL PROTECTED]
413-559-5556

"...our behavior matters more than the beliefs that we profess."
                                Elizabeth Deutsch Earle
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/


DISCLAIMER:
Disclaimer.  This e-mail is private and confidential. If you are not the 
intended recipient, please advise us by return e-mail immediately, and delete 
the e-mail and any attachments without using or disclosing the contents in any 
way. The views expressed in this e-mail are those of the author, and do not 
represent those of this company unless this is clearly indicated. You should 
scan this e-mail and any attachments for viruses. This company accepts no 
liability for any direct or indirect damage or loss resulting from the use of 
any attachments to this e-mail.
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to