"Gofmt's style is no one's favorite, yet gofmt is everyone's favorite."
We need more of the same, I really wish C# had a similar opinionated tool I could use to bring dozens of company projects in line.
Something that can be run locally and in CI and has ZERO configuration, it just enforces a static style with no possibility of bikeshedding.
[0]: https://journal.stuffwithstuff.com/2015/09/08/the-hardest-pr...
Nit: to whit
EDIT: nit: to wit
> Traditional line length research, limited to print-based text, gave a variety of results, but generally for printed text it is widely accepted that line lengths fall between 45 and 75 characters per line (cpl), though the ideal is 66 cpl (including letters and spaces).[1] For conventional books line lengths tend to be 30 times the size of the type, but between 20 and 40 times is considered acceptable (i.e., 30 × 10pt font = 300 pt line).[1]
* https://en.wikipedia.org/wiki/Line_length#Printed_text
There's a section of "electronic text" as well which goes into some factors (flicker, glare), but the number doesn't seem to change that much.
LaTeX defaults to that, but Plain TeX defaults to 10pt font with 1in margins, which is ~100 characters per line (which much too long to be readable).
The blog referenced in the article as "extremely, almost unreadably bad" clocks in at ~300 characters per line, with the classic wall of text appearance which makes it very tiring to read.
Although I would recommend focusing at least one level higher than :vsplit, either at the terminal multiplexerv level or the (tiling) window manager level. Otherwise you end up wanting to run a shell in your editor... And what do you think this is, emacs?
My mainframe indoctrination there.
In terms of screen reading width, there's some sweet spot where characters per screen "page" and characters per line are easily readable without the text being "big". I need to be able to move my eyes left to right without losing track of my vertical position on the page.
Wrapping at 88 in java code, where I have method names almost that long, would use too much vertical space and lead to constant scrolling.
This may be an issue with the information density of java code, absolutely, but I don't want ordinary-length functions disappearing off down the screen.
YMMV.
This article includes a throwaway link to the wikipedia page at the end of that quote. I recommend reading the relevant section (https://en.wikipedia.org/wiki/Line_length#Electronic_text), because it's pretty limited. There is really no way to tell if it (or Glyph) are accurately summarizing the research.
Overly long lines have a similar flaw - they compress too much information, so there's quite literally, no rhyme or reason.
So my approach is to have some sort of honor system: write something that you believe that will be readable to a variety of humans, where similar things are grouped together, and different things are laid out apart.
I do have a limit like 240, but that's more like a guardrail, not an invitation for every line to be that long.
Well yeah, this seems to be a bit of a straw man. Nobody is suggesting 200 characters. But 80 is definitely anaemic. I think 100 is quite low too, so it seems bold to say "maxing out at 100".
120 is the most comfortable I've found, striking a good balance between readability, excessive wrapping, and side-by-side viewing.
Most lines fit under 66. A lot more than 50%, even code written by other people. I'd say most lines also fit under 80, and very rarely do lines actually cross 120.
I wonder what it is that makes different people choose different limits.
llimos•1h ago