View Single Post
  #109   Report Post  
Robert Bonomi
 
Posts: n/a
Default

In article ,
Doug Miller wrote:
In article , lgb
wrote:

Back in the early days, I had at least one job that required writing
Cobol programs. I was told my Cobol looked like Fortran :-).
Apparently most people didn't even know Cobol had a COMPUTE statement.


No, we just *wish* it didn't. Destroys readability. Except for Fortran
programmers. :-)


Some COBOL code is _intrinsically_ virtually unreadable. without COMPUTE.

Try to imagine what data-decompression algorithms look like in COBOL.
(It _wasn't_ a matter of choice, that was the *only* language that that
shop used. CICS command-level COBOL, in fact.)

Variable width bitfield data is all *sorts* of fun.

line after line of
DIVIDE foo INTO bar GIVING baz, REMAINDER quux.

with various
MULTIPLY something BY power_of_two,
ADD this TO that GIVING result.
thrown in, 'as needed'.

It's _all_ scratch-pad temporary variables, there's *NO* way to assign
'meaningful' names.

Plus, 'bit twiddling' is an utterly foreign concept to COBOL programmers
in the first place.

There is simply _nothing_ you can do to make that code 'readable' by anyone
other than a systems "guru". And _they_ have to puzzle over it for quite
a while, because it would *never* occur to them to try to do that kind of
thing in _that_ language.

The _internal_ documentation for _what_ that module was doing was six or
seven times the size of the of the functional parts of the PROCEDURE and
DATA divisions combined. And management _still_ put a declaration on the
front of that module forbidding *anyone* but the author to modify it.