Live data from Hacker News

80 Characters per Line Is a Standard Worth Sticking to Even Today

nickjanetakis.com

41–48 of 48 posts

Re: 80 Characters per Line Is a Standard Worth Sticking to Even Today

#42

I think software is common enough in nearly every editor you not enforce limits, but instead "one thing at a time" rules.

Many lines to do one things, or many things on one line, are what makes code hard to read. Not the number of letters.

Re: 80 Characters per Line Is a Standard Worth Sticking to Even Today

#43

We also enforce this. Not for personal or aesthetic reasons, but to keep code reviewers sane and let them review code side-by-side (as many devs do) when they might not have an ultra-wide monitor available.

What tabsize do you enforce and how many meetings were it before a number was agreed upon?

Doesn't matter. What matters is consistency in the repo. To this effect, it's important the CI process enforces it - code reviewers could never do it, and it's a waste of their time. I highly recommend auto-formatters like Black, Prettier, Gofmt, etc. They take so much cognitive load off devs and reviewers, it's completely worth it. (In practice, this means whoever sets up the CI process gets to decide :P)

Re: 80 Characters per Line Is a Standard Worth Sticking to Even Today

#44

Earlier quoted context omitted.

Also `var` is such an important mitigatory for this in C# that it continues to astound me that some of the worst offenders also eschew `var` in C#. You really don't need the redundancy of `ImmutableSortedDictionary localCache = new ImmutableSortedDictionary ()`, it's not some sort of Prolog assertion where the strict tautology makes different code than `var localCache = new ImmutableSortedDictionary ()`.

The problems start when you open code to see var localcache = cachemaster.cacheFor(foo); Now you have no idea what it is until you dig into the (hopefully correct) API docs, or use an IDE that can untangle things.

I don't buy it. It's one jump to method definition away, which even an editor without IDE capability should be able to manage. But also, this is what dynamic languages look like, and people still manage to be productive.

(I'll agree it can be a bit tricky with LINQ and anonymous types in C#, but I think `var` usage is worth that trade-off)

Re: 80 Characters per Line Is a Standard Worth Sticking to Even Today

#47

Textbooks and newspapers print in multiple columns, even when using tabloid size paper, because it’s more readable. There’s empirical evidence to back it up. The “I have a big monitor” guys just need to stop. Please.

Edit: “I have a big monitor - and I’m going to write all the way across it”. That’s what needs to stop.
Post reply on HN