Why is the default terminal width 80 characters?

后端 未结 6 1292
梦毁少年i
梦毁少年i 2021-01-31 16:24

80 seems to be the default in many different environments and I\'m looking for a technical or historical reason. It is common knowledge that lines of code shouldn\'t exceed 80 c

6条回答
  •  日久生厌
    2021-01-31 16:31

    Your computer probably doesn't have a punch card reader, but it probably does have lpr(1) which follows the convention set by IBM for punch cards. The lpr(1) command defaults to Courier font with margins set for 80-columns and 8-space tabs for plain text files on 8.5"x11" paper. Try cat foo.c | lpr and if the author of foo.c used conventional line width and source code formatting rules, then the printed page will look mostly readable. Otherwise, best not to kill the trees.

提交回复
热议问题