For Programmers: Free Programming Magazines  


Home > Archive > Cobol > August 2007 > Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
Richard

2007-08-01, 3:55 am

On Aug 1, 11:12 am, "Pete Dashwood"
<dashw...@removethis.enternet.co.nz> wrote:

> I don't intend to arguye your comments on "complexity" Richard, other than
> to say it is all relative and subjective. (Even though you are attempting to
> "calculate it" objectively.)


So, do you think that my assigning 10,000 as the complexity factor for
ALTER was not objective ?

I think that is exactly how many times that I would object to an
ALTER. ;-)


> The fact that the statement COULD be switched from anywhere in the program
> to anywhere else, doesn't mean it WILL be...
>
> And even if it was, statements must appear in source to do it and these can
> be tracked.


Yes, it certainly will be within the source, but that is a point I
have made before. If, for example, GO TOs are allowed from any point
in a program then the only way to know how a small piece of the
program works is by examining the whole program looking for Go TOs
that are to labels within the range of the code of interest.

If there are ALTERs then this is not enough because each GO TO may
have a range of targets which are not part of the GOTO itself* and
thus for each GOTO the whole program has to be examined for all the
ALTERs which reference this to find out if it could goto the range of
the code of interest.

If we strip off all the ALTERs we reduce by an order of magnitude the
search required to undestand the program.

Similarly with GOTO. If GOTOs do not exist in a program then we can
with greater confidence examine small parts of a program without
needing to understand all of it. If gotos are only tolerated within a
defined area (such as within each section) then it is only necessary
to examine that to understand enough about the small part in question.

Being lazy I am not interested in examining any more of the source
than is absolutely necessary, so I code to suit that requirement as
best I can.


* I recall (1970?) seeing a program where the altered GO TOs had a
list of possible targets (like a GOTO DEPENDING ON without that
clause) and it would be an error to have an ALTER to one not on that
list. Checking my reference it seems that is not part of COBOL and may
have been an extension. However, I had not seen ALTER before, and once
I worked out what was happening I suggested that the program be burnt
at the stake**, the programmer was not available.

** As a total aside, IIRC in Pocklington, opposite the Black Bull pub,
there is a plaque commenorating the last public witch burning in
england.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com