Stories
Slash Boxes
Comments

SoylentNews is people

posted by Fnord666 on Saturday June 20 2020, @03:04AM   Printer-friendly
from the depends-on-whether-you-code-using-emacs-or-vim? dept.

Are 80 Characters Per Line Still Reasonable In 2020?

[...] In case of the Linux kernel, that's of course [Linus Torvalds], who has recently shaken up the community with a mailing list response declaring an overly common, often even unwritten rule of code formatting as essentially obsolete: the 80-character line limitation. Considering the notoriety of his rants and crudeness, his response, which was initiated by a line break change in the submitted patch, seems downright diplomatic this time.

[Linus]' reasoning against a continuing enforcement of 80-char line limits is primarly the fact that screens are simply big enough today to comfortably fit longer lines, even with multiple terminals (or windows) next to each other. As he puts it, the only reason to stick to the limitation is using an actual VT100, which won't serve much use in kernel development anyway.

Allowing longer lines on the other hand would encourage the use of more verbose variable names and whitespace, which in turn would actually increase readability. Of course, all to a certain extent, and [Linus] obviously doesn't call for abolishing line breaks altogether. But he has a point; does it really make sense to stick to a decades old, nowadays rather arbitrary-seeming limitation in 2020?

The article then gives an overview of the history of how 80 columns became the de facto standard width. Though mentioned briefly in passing, it all really got started with the invention of the punched card dating back to 1804 when "Joseph Marie Jacquard demonstrated a mechanism to automate loom operation". The physical size of the punch card used in the 1890 United States Census was the same as US currency at that time. The cards were then known as "Hollerith cards" after the inventor Herman Hollerith. Later, IBM came to dominate the field.

As technology progressed, punch cards eventually gave way to computer terminals such at the IBM 3270 and "glass TTYs" like the DEC VT05 and Lear Siegler ADM-3A.

Computer languages were even designed around that common size. Both FORTRAN and COBOL had fixed line layouts with certain columns reserved for such things as sequence numbers, comment indicator, continuation marker, as well as the code itself.

Human factors play a role, too. A newspaper could, for example, have lines of text as long as the page is wide. It was found to be difficult to connect visually where the next line would start when one reached the end of a physical line. Hence multiple columns of text on a page. The same often holds for magazines, too.

Back to the question at hand.

I have personally used punch cards, FORTRAN, COBOL, and all of the computer terminals listed. I generally aim for 80-columns in the code I write, but I am flexible about it. Should I find that 90-100 columns better allows me to express and comprehend the code I've written, I'll err on the side of using more columns. A quick look through some code I've written revealed one case where I used 132 columns.

What about you? Hard and fast limit of 80 columns and not a single column more? 80-90? 100? Whatever it takes? Where and how do you draw the line?


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 0) by Anonymous Coward on Saturday June 20 2020, @11:22AM (2 children)

    by Anonymous Coward on Saturday June 20 2020, @11:22AM (#1010324)

    The 80-column format is a common denominator of screen formats for all devices. 40 column looks pixelated even on a small screen, 120 is hardly readable even on 15-inch display. So it's more a viewing compatibility thing for me than a strict requirement.
    I write e-mails with 80-column mode and it is really nice for readability on all devices - I can read it horizontally, or vertically, when I use PDA like a book. It can be viewed in a smartphone or a book reader too.
    The problem with wide lines is that you don't know what font programmer has and how the code will be shown. I like my "gut-like" 4096x1536 display set, but text good looking there (a format of larger newspaper) looks awful even on "HD" displays.
    When coding, I don't necessarily stick to 80column, but I prefer it.

  • (Score: 2) by bart9h on Saturday June 20 2020, @11:27AM (1 child)

    by bart9h (767) on Saturday June 20 2020, @11:27AM (#1010327)

    You must be almost blind.

    My vision have worsened considerably in the recent years, so I'm using a stupdily huge font size for the terminal, and it still has 141 columns on a 15" screen.

    • (Score: 1, Insightful) by Anonymous Coward on Saturday June 20 2020, @12:45PM

      by Anonymous Coward on Saturday June 20 2020, @12:45PM (#1010353)

      Probably you're operating full-screen. In a full-screen, a 140 column is good if a font is good. I was operating this mode for decades in Lotus spreadsheet (14-inch screen) until I met poor Linux fonts in which it was just impossible as everything was so thin that it was unreadable. The white bleed caused by flat screens has also important role to make everything but serifs blurry. Fortunately, modesetting can be patched to use different font and not switch back.

      About full-screen - Modern applications are written with no respect to user's memory or CPU, so full-screen applications are more and more common, rendering machines single-task again.
      Meanwhile, I have a favorite tmux set-up which is a quad-80column on a 20-inch screen.
      And I found that it is impossible for me to reliably read console wider than 80-columns on my PDA, which is around 5.5-inch.