[SATLUG] home computer
jbharrell at fusemeister.com
Tue Dec 5 17:06:20 CST 2006
Benjamin Temple wrote:
> it would be even worse is it had said "teletype with COBOL" Ive heard the
> language is hard to learn.
COBOL (ah, memories) is not hard to learn -- the question is "how
verbose do you want to be". As an example snatched right from Wikipedia,
if you wanted to write a statement to compute one of the roots of the
X = (-B + SQRT( B^2 - 4 * A * C) ) / 2 * A
one solution uses the compute verb:
COMPUTE X = (-B + (B ** 2 - (4 * A * C)) **.5) / (2 * A).
As an alternative, this could also be written as:
MULTIPLY B BY B GIVING B-SQUARED.
MULTIPLY 4 BY A GIVING FOUR-A.
MULTIPLY FOUR-A BY C GIVING FOUR-A-C.
SUBTRACT FOUR-A-C FROM B-SQUARED GIVING RESULT-1.
COMPUTE RESULT-2 = RESULT-1 ** .5.
SUBTRACT B FROM RESULT-2 GIVING NUMERATOR.
MULTIPLY 2 BY A GIVING DENOMINATOR.
DIVIDE NUMERATOR BY DENOMINATOR GIVING X.
But, it's really clear.
Here some humor from Wikipedia:
Aphorisms and humor about COBOL
It has been said of languages like C, C++, and Java that the only way to
modify legacy code is to rewrite it - write once and write once again;
or write once and throw away. On the other hand, it has been said of
COBOL that there actually is one original COBOL program, and it only has
been copied and modified millions of times.
The name "ADD 1 TO COBOL GIVING COBOL" has been suggested for a
hypothetical object-oriented dialect of COBOL, as a play on the name
C++. While this is meant to suggest that COBOL is inherently verbose,
the form given is more verbose than COBOL actually requires.
Alternative expansions of the COBOL acronym have been suggested:
* Compiles Only Because Of Luck
* Compiles Only By Odd Luck
* Completely Obsolete Business Oriented Language
* Completely Over and Beyond reason Or Logic
More information about the SATLUG