Ask Hackaday: Are 80 Characters Per Line Still Reasonable In 2020?

Software developers won’t ever run out of subjects to argue and fight about. Some of them can be fundamental to a project — like choice of language or the programming paradigm to begin with. Others seem more of a personal preference at first, but can end up equally fundamental on a bigger scale — like which character to choose for indentation, where to place the curly braces, or how to handle line breaks. Latest when there’s more than one developer collaborating, it’s time to find a common agreement in form of a coding style guide, which might of course require a bit of compromise.

Regardless of taste, the worst decision is having no decision, and even if you don’t agree with a specific detail, it’s usually best to make peace with it for the benefit of uniformly formatted code. In a professional environment, a style guide was ideally worked out collaboratively inside or between teams, and input and opinions of everyone involved were taken into consideration — and if your company doesn’t have one to begin with, the best step to take is probably one towards the exit.

The situation can get a bit more complex in open source projects though, depending on the structure and size of a project. If no official style guide exists, the graceful thing to do is to simply adopt the code base’s current style when contributing to it. But larger projects that are accustomed to a multitude of random contributors will typically have one defined, which was either worked out by the core developers, or declared by its benevolent dictator for life.

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?

Continue reading “Ask Hackaday: Are 80 Characters Per Line Still Reasonable In 2020?”

Copy And Paste Deemed Insecure

Back when Windows NT was king, Microsoft was able to claim that it met the strict “Orange Book” C2 security certification. The catch? Don’t install networking and remove the floppy drives.  Turns out most of the things you want to do with your computer are the very things that are a security risk. Even copy and paste.

[Michal Benkowki] has a good summary of his research which boils down to the following attack scenario:

  1. Visit a malicious site.
  2. Copy something to the clipboard which allows the site to put in a dangerous payload.
  3. Visit another site with a browser-based visual editor (e.g., Gmail or WordPress)
  4. Paste the clipboard into the editor.

Continue reading “Copy And Paste Deemed Insecure”

One-Percenter Mods For Premium Apple Pencil Usability

At $129 USD, Apple certainly do sell a very expensive “pencil”. Despite the high cost of entry, [Eric] identified several shortcomings and set about solving them himself with a few choice mods.

The first concern is the excessively slippery surface finish, that could lead to the expensive device being dropped and damaged. [Eric] starts by creating a special tool to help handle the pencil during the refinishing process. He highlights how key this is to getting a good final result, without fingerprints or other flaws ruining the finish. With the manipulator ready, the pencil is then given a wipe down with wax and grease remover prior to a dusting of a translucent spray paint. The finish is poor, however, and [Eric] instead elects to try again with a plastic primer first. A series of tinted clear coats are chased with a urethane clear topcoat for a hardy, grippier surface texture.

The final mod concerns the tip. It’s lathed down in a power drill to give a shape more akin to the ballpoint pens [Eric] is used to sketching with. Additionally, the tip is dyed black with a Sharpie marker and a heat gun, to help it contrast better when sketching on a white screen.

These mods may seem trivial to a casual user, but for a designer who draws for a living, usability is key. The striking orange finish is just a bonus. We don’t see too many stylus mods, but with the increased popularity of tablets, we’re sure to see more down the road. If you’ve got one, be sure to drop us a line! Video after the break.

Continue reading “One-Percenter Mods For Premium Apple Pencil Usability”