I completely agree with Frank on the use of ALTER - it makes normal debugging of programs VERY difficult especially when the programs in questions are 20,000+ line dinosaurs that have been modified many times over the decades by many different programmers.
I also agree with use of GO TO, but the normal use I have for this was to go FORWARD to the end of a PERFORM'ed section of code to the exit. Backwards GO TO's are always fraught with potential issues IMO. Bottom line is no matter what restrictions you have in place they will be abused by some programmers. Bad coders can code poorly no matter what controls you try to put in place. -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Frank Swarbrick Sent: Wednesday, July 13, 2016 1:31 PM To: [email protected] Subject: Re: Considering Enterprise COBOL 5.2 "exit" enhancements With the elimination of procedure division sections and PERFORM THRU, and without the use of GO TO, there should be no reason to insert such a label. The new EXIT statements allow us to do all (?) of this without the need for doing those "more dangerous" (in my opinion) things. ALTER is bad because its not obvious when you look at a piece of code where it might actually branch to. Depending on the program complexity I have every intention of removing the use of procedure division sections and perform through. Anyway, would you agree that because they are there it probably makes sense to come up with some best practices for their use, rather than simply recommending they not be used? That was my intent in my original post to the Cobol Cafe, but you derailed that a bit my rallying against it. :-) Frank ________________________________ From: IBM Mainframe Discussion List <[email protected]> on behalf of Bill Woodger <[email protected]> Sent: Wednesday, July 13, 2016 4:14 AM To: [email protected] Subject: Considering Enterprise COBOL 5.2 "exit" enhancements Please list from all those languages in which of them the logic flow changes by adding a label. There is nothing intrinsic with ALTER ... TO PROCEED TO ... or GO TO ... DEPENDING ON ... or GO TO itself which makes it "bad", it is the way that they were (ab)used. "My program is 'Structured' because I replaced all the GO TOs with a 'Structured' construct'. Well, no. It is my expectation that the new EXIT options will be roundly (ab)used. Future history will tell. Since I have no normal need for GO TO, I have no normal need for these constructs. This biases me against them. Superficially, anything which enhances the idea to use single paragraphs (or SECTIONs with no paragraphs) for PERFORM is good. No dumb "exit paragraphs" means no target for a GO TO. However, if then secret GO TOs can instead be used, some of the point is lost. Practically, no program is going to be changed to replace PERFORM ... THRU ... or PERFORM of a SECTION containing (referenced) paragraphs just because EXIT PARAGRPAH exists. Yet EXIT PARAGRAPH and EXIT SECTION are there, and quite posibly will be used in those situations. After all, they are "Structured" so "good" and better than a GO TO, so the thinking will go. Is the behaviour clear? I suppose ask people. In my example in the first post, I suspect that people will assume the "exit paragraph" 'exits' the PERFORM. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
