|
|
Warp wrote:
> Who ever thought that would be a good idea? Who understands that?
Grace Hopper?
> So what's the point in having both syntaxes?
Because an awful lot of times, just the one addition or multiplication is
what you need.
MULTIPLY RETAIL-PRICE BY DISCOUNT-PERCENT GIVING DISCOUNTED-PRICE.
MULTIPLY DISCOUNTED-PRICE BY SALES-TAX-PERCENTAGE GIVING SALES-TAX.
ADD SALES-TAX TO DISCOUNTED-PRICE GIVING TOTAL-DISPLAYED-ON-REGISTER.
It makes it trivially easy to see that the sales tax is applied to the
discounted price, not the original price, for example.
In all the programs I wrote in 2 years of full time cobol programming, I
think I used COMPUTE maybe twice? You almost always need the intermediate
values anyway, in business calculations.
> people thought that it's cool if you can write "plain English" and have
> the computer understand it. Whether it's actually practical is secondary.
No. It's because the boss can understand stuff like what I wrote above. Just
like lots of the limitations of early FORTRAN[1] were there to make it
possible to compile into something as efficient as assembler.
Look at something like a US tax form. The math is all trivial, one operation
per line.
Scientific computing (a la fortran) didn't work this way for a reason: the
formulae aren't usually trivial in science, and you usually don't need the
intermediate values.
[1] Like the fact that there were only a handful of valid expression forms
you could use for a subscript, because that was the only way to ensure you
could use these new-fangled index registers.
--
Darren New, San Diego CA, USA (PST)
There's no CD like OCD, there's no CD I knoooow!
Post a reply to this message
|
|