Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 15 submissions in the queue.
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: 2, Interesting) by Ethanol-fueled on Saturday June 20 2020, @03:20AM (4 children)

    by Ethanol-fueled (2792) on Saturday June 20 2020, @03:20AM (#1010247) Homepage

    Because, if you used a modern IDE like Eclipse or Visual Studio, you'd see that 75 percent of your monitor real-estate is filled up to the ass on the left and right by toolboxes, explorers, and other bloated toolbars, leaving you with only a tiny column in the middle to actually look at code.

    Somewhat related, I'm working on a personal project using the Nano 33 BLE Sense board to use its sensors to automatically adjust the monitor to/from portrait/landscape orientation when the monitor is physically flipped. It will use its internal magnetometer, rather than the gyroscope, to measure position. The reason for that decision is because using gyros to get position requires a lot of ugly math and error corrections, and won't register change of state when the monitor is moved during power-down. That means using the magnetometer will require a 1-time zeroing in each position, and possibly again if the user intends for the monitor to be physically translated as well as rotated. It will communicate of course via bluetooth because fuck extra cables on a monitor stand, though it could also be done wired using serial. The form factor will be roughly like a small pack of gum and will be powered by a watch battery or two, using the board's low power mode to save juice when appropriate.

    But since I'm a lazy fuck surely one of you now has enough information to do it yourself before I get it done.

    Starting Score:    0  points
    Moderation   +2  
       Insightful=1, Interesting=1, Total=2
    Extra 'Interesting' Modifier   0  

    Total Score:   2  
  • (Score: 2) by JoeMerchant on Saturday June 20 2020, @03:24AM (3 children)

    by JoeMerchant (3937) on Saturday June 20 2020, @03:24AM (#1010250)

    magnetometer

    I hope you meant accelerometer... getting monitor orientation from a magnetometer would be needlessly challenging.

    --
    🌻🌻 [google.com]
    • (Score: 0) by Anonymous Coward on Saturday June 20 2020, @04:49AM

      by Anonymous Coward on Saturday June 20 2020, @04:49AM (#1010271)

      Not really. It has a 3-axis magnetometer, so all he'd need to do is have it poll every so often for a change from strongly on one axis to strongly on another. But he'll want a fairly weak magnet to place on the stand do that with. One problem I noticed from a quick glance at the datasheet is that particular board's magentometer looks like it can easily be swamped by even a refrigerator magnet, as it looks to be designed for use as a compass or the like.

    • (Score: 2, Interesting) by Ethanol-fueled on Saturday June 20 2020, @04:53AM (1 child)

      by Ethanol-fueled (2792) on Saturday June 20 2020, @04:53AM (#1010273) Homepage

      Not in this case, the magnetometer readings hold steady and differ with each position, I've already tried it. It's a 3-axis magnetometer that's very configurable with regard to gauss range and other parameters. If there are problems a combination of accelerometers+gyro+magnetometer could be used.

      Accelerometers + gyro register only the rate of change, so you're only getting zeroes with the monitor still. You have to get position by integrating and fucking with error terms, and if you move the monitor with the system powered down, the movement won't register when the system is powered up (unless you want to do the flip event within the Arduino if even just as a physical button press). The magnetometer gives steady but easily differentiable values that change with position and not velocity. The calibration and flip events will be handled on the Windows system side using a background running application that hides in the notification area.

      • (Score: 3, Touché) by JoeMerchant on Saturday June 20 2020, @12:20PM

        by JoeMerchant (3937) on Saturday June 20 2020, @12:20PM (#1010344)

        Accelerometers + gyro register only the rate of change

        Are you on the space station?

        Where I work, and where my products get used, accelerometers point down. On a dynamic platform like a small aircraft you'd want to add a gyro to keep track of dynamic rotations and integrate the accelerometer, but on a stable desktop there's no need for that.

        Magnetometers get all kinds of screwy inside of commercial (steel frame) buildings, and cars, and the angle of declination changes pretty significantly as you move around the planet.

        --
        🌻🌻 [google.com]