3 ms·
ALGOL (or rather, the various incarnations thereof) was a very different animal from any programming language we're familiar with nowadays. I'd say modern langu
by zozbot123 8y ago
ALGOL (or rather, the various incarnations thereof) was a very different animal from any programming language we're familiar with nowadays. I'd say modern languages might owe just as much to COBOL - didn't the "record" or "struct" concept originate from there? As another data point, the verbose syntax of COBOL programs also allowed for the use of longer identifiers, quite similar to ones we'd write today even in a "low-level" language like C.
- tabtab 8y agoAlgol introduced some key concepts used today, such as nested blocks instead of go-to's (or at least prefered over), and readable-versus-writable parameters (similar to by-value versus by-reference parameters). The length limit of variable names was mostly a hardware-centric concern back then, I believe; not a language design preference itself. It was bound to expand as hardware got cheaper & faster. The first compilers were really slow; shortcuts mattered a lot. I will agree that things like "record statements" may have come from the COBOL camp, although there may have been precursors in punched-card templates. I should note Algol was influenced by FORTRAN.
- vorg 8y ago> the verbose syntax of COBOL programs also allowed for the use of longer identifiers Virtually every Cobol site out there also requires programmers to prepend their user-defined names with some mnemonic, e.g. pg5005-this-paragraph lv-this-local-variable acpr7502-all-variables-in-programs-in-accounting-system-payroll-subsystem This also means they never confuse user-defined names and program keywords.
- ams6110 8y agoAt least in early versions there would have been some motivation to constrain the length of variable names, because a line of code needed to fit in an 80 column punch card.
- eesmith 8y agoI don't believe you are correct. I found nothing in the COBOL 60 documentation concerning a required width. The closest (in section VIII "Reference Format") was "right hand margin Z is determined by the width of the paper or printing media". While it's true that the 80 column IBM card was by far the most popular, other options were available. I can believe that a COBOL implementation for the Remington Rand might use all 90 columns. The COBOL 60 documentation says (section 2, "Words") that variables are no more than 30 characters in length. There was no need to fit everything in the same physical line because COBOL 60 supported line continuation, using a "-" as the last character position of the line (section VIII-2, "Reference Format"). This could even occur in the middle of a name.