4 ms·
> Very few resources explain this, but having the code in strict positions was what allowed old computers to read the instructions on punched cards. On punched
by kragen 4y ago
> Very few resources explain this, but having the code in strict positions was what allowed old computers to read the instructions on punched cards. On punched cards, a certain COBOL statement, let’s say an IF statement, is mapped to a pattern of holes. If you know that a statement starts at a certain column (12-72 in COBOL), it is easier for the hardware to read (this was done by passing a light through the card).
i think it would be more accurate to say that dividing punched cards into predefined fields was a pre-existing practice (dating back to the census of 01890) which was unthinkingly copied when punched cards were adapted to applications for which it is a stupid idea, such as programming
it's true that iterating over the leading blanks on a free-form card to find the first nonblank character takes more cpu time than just looking at column 8, but those cpu savings are so minor as to be lost the first time a compiler run has to be aborted because someone accidentally punched their statement starting in column 7
cobol, being a dod initiative, didn't care much about whether ideas were stupid as long as they could be made to work, and hci (and even ergonomics) was still in its infancy
(what would i know about unthinking copying? well, just last night i formatted my code to fit within 80 columns, ultimately because that was the width of ibm cards, and therefore of many printers, terminals, and character generators, and is still the default width of many terminal emulators)
- Retric 4y agoIt’s easy to overstate how important this kind of copying is. 80 characters is a nice round number that’s roughly the minimum reasonable width of a programming interface. It’s perfectly possible to code using a 40 or 60 character wide terminal, but there is significant utility from hitting 80. Meanwhile the gain from hitting 100 or 120 characters isn’t as significant. Similarly you might have frequently used a 237 character wide editor or similar uninteresting number. Those odd numbers are simply happenstance with little reason to discover what they are or recall if you do happen to find out.
- kragen 4y agoi think 80 is maybe a bit large for code; in most languages it's rare for a line of code to go past column 64, unless you're using 8-space indents, and those rare cases are often bad code. if your code was formatted for 64-character width, you could fit 12 columns across a 3840-pixel 4k display with a 5-pixel-wide font, versus only 9 columns if each was 80 characters wide 40, 64, 81, 128, or 121† would have been more logical; 72, 84, 90, 96, 108, 126, and especially 120 could be divided into equal columns in a larger number of ways; and for single columns of text, 80 is also a bit too large for optimal readability (it's about 14 words per line), but too small to fit two columns of text the way traditional book layouts do usa typewriters commonly used 10 or 12 characters per "inch" ("pica" and "elite" respectively) which works out to 85 or 102 characters respectively across a sheet of usa letter paper, or 82 or 99 characters across a sheet of iso a4 paper, so plausibly the character width for fixed-width printers for these paper sizes had to be somewhere in the range 76-102 this week though i've been programming in proportional fonts, so the whole question of width becomes less well-defined. specifically the font lobster two because fuck you that's why ______ † 136? yes, because that's the most positive number you can represent in five trits of balanced ternary. in our timeline of course nobody uses balanced ternary, but plausibly if people had been doing this sort of optimization instead of following tradition, they'd have switched to balanced ternary 70 years ago
- kragen 4y ago> † 136? yes, because this should have read "121"
- Retric 4y agoPeople generally want borders around the text they’re editing. This makes the width of the editing area more arbitrary than simply the width of the screen / fixed width font.
- kragen 4y agothis is a good point; even half a character cell helps a lot