3 ms·
Of course COBOL had comments. You put an asterisk at the start of the line, or in a particular column, depending on the compiler's extensions for doing away wit
by SulphurCrested 4y ago
Of course COBOL had comments. You put an asterisk at the start of the line, or in a particular column, depending on the compiler's extensions for doing away with line numbers. What the Stack Overflow link is saying is that it didn't have comments that could follow a statement on a line, but got them at roughly the same time C got C++-style // comments.
I only did a couple of short paid stints with the language, back in the 1980s, but from my memory of it the biggest problem with it was the huge number of reserved words. One project therefore mandated that every identifier start with "100-"! The problem with globals was real, but contemporaneous Pascal had a globals problem too. There was a mechanism to interpolate source code of procedures; since the language had been designed back in the days of batch jobs elapsed compilation time didn't matter.
COBOL programmers tended to be isolated from the wider programming world and from people with a formal background in computer science. I arrived at that project too late to prevent them making design decisions like firing up a new executable for each transaction (expensive on VAX/VMS, but at least it was in the same process) or storing passwords in cleartext. They just did it the way they'd done it 15 years before on the big iron. It was a case of "I wish you'd been here 6 months ago to tell us about that, but it's too late now", or perhaps they were just being polite to the hired help.
You could argue that whatever the business-oriented language had been, those same people would have made the same mistakes. At least with COBOL, the language was such that they could be domain experts, for example accountants.
- manuelabeledo 4y ago> Of course COBOL had comments. Funny anecdote about this. I used to work on a relatively old (early 1980s) COBOL and PL/1 codebase. Code was obviously a mess, as most of the files were written by non devs, and hardly had any comments. There was this one though, that started with something like "this code handles currency conversions, and the author is long gone now; no one understands it, but if you need to modify it, please be aware that you may break all the business logic the bank relies on". Code was modified once, in the late 90s, to support some Euro and Y2K oddities. No one else dared to touch it afterwards.
- cratermoon 4y agoBut hardly anyone wrote very many comments in the early days because every comment was another punch card, with all the attendant problems that only grow the larger the deck grows.