4 ms·
These feel-good statements ignore the fact that ancient COBOL was based entirely around global data and GOTOs. There were no block structures or loops. You kind
by kagakuninja 4y ago
These feel-good statements ignore the fact that ancient COBOL was based entirely around global data and GOTOs. There were no block structures or loops. You kind of had procedures (I think), in which programs can call other programs. But you still ended up with thousand line files, all linked by GOTOs and GOSUB.
All GOTOs. Is GOTO not powerful enough? Good news, we have GOTO DEPENDING ON. The destination of your GOTO is determined by a variable.
Youngsters may not realize just how bad GOTO based code can be. This is where the term spaghetti-code comes from. I still remember as a teenager, trying to understand how a BASIC maze generator program worked. I printed out several hundred lines of source and proceeded to study it. And eventually gave up after an hour.
I'm sure later variants of COBOL introduced blocks, loops and procedures. But that 50+ year old system will be all GOTOs...
- AlbertoGP 4y agoI see, even if clear unambiguous lines by themselves are a good thing, there might be plenty of reasons to stay away from a COBOL system in particular.