3 ms·
I worked for one of those companies using COBOL. This strikes me: > Once I discovered what the problem was, the fix was easy: I deleted one character of white s
by ibizaman 9y ago
I worked for one of those companies using COBOL. This strikes me:
> Once I discovered what the problem was, the fix was easy: I deleted one character of white space from the beginning of line 19, which put the period at column 72. Although I'd never encountered it before, this was such a common bug that many mainframe COBOL programmers would tape a piece of thread between columns 72 and 73 on their terminals.
Why would you want a compiler/language that allows you to shoot yourself in the foot for 1 misplaced character in the source file, without raising an error instead of blindly executing the code?
Like you said, it can change completely the logic of the code so it could be disastrous and go unseen, especially in business transactions?
I know things changed recently. But I would be very surprised if the company I worked updated their COBOL version.
- jacquesm 9y agoIn those days single bytes mattered and using fixed positions for the start of comments on the punchcards made sense. Of course retrospectively with gigabytes at our disposal it is hard to put yourself in that frame of mind. Maybe it helps to understand this better if you realize that the assembler that I cut my teeth on only supported 6 character labels and symbols.
- waltman 9y agoThat 72-character limit came about because the most popular IBM punch card reader at the time COBOL was being written could only read 72 of the 80 characters on a card. Once you know that anything after column 72 will be ignored, you can repurpose those columns for other things. At my shop we used them to denote revision numbers. And once practices like that get set, you're pretty much stuck with the older formatting rules.
- dodders 9y agoYup. When I used RPG400 we'd use the first 4 columns for revision numbers as they were originally reserved on the punched cards but not used on the editor...
- greenleafjacob 9y agoThis is trivially solved by linters.
- waltman 9y agoIt's also solved by modern editors that do syntax highlighting. Both emacs and vim flagged that period as an error when I was working on the example in the article. But sadly the editor I was using at the time did not.