Live data from Hacker News

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

nickjanetakis.com

31–40 of 48 posts

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

#31
post #8

Vscode does an autowrap maintaining the indent. So you can have it at any number. I don’t get the 80 char width fanatics. I like long lines. I want my editor to format it based on my screen width. 80 breaks my flow.

That's great if you are working alone or on a team where everyone agrees on the same editor with the same auto-wrap feature. In a mixed environment, writing code that is only readable if people choose the same tools you prefer can be a bit rude.

No, if you don't hard-wrap inside lines, then each person can use their own editor with auto-soft-wrap they like.

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

#33
80 vs 120 makes it easy to declare 80 the winner, but I'm less convinced that 80's better than 90 or 100, especially for JS with callbacks. There's simply a couple extra indentation stops compared to languages like C or Go.

100 seems like a good modern take to me.

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

#34

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.

Unified diffs beat side-by-side the majority of the time IMO.

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

#35
post #11
post #2

You can tear my 120 character line width from my cold dead hands.

Cold dead hands won't be writing any more unreviewable code.

You can fit 120 characters side-by-side on a 1080 monitor no problem (and I regularly do)

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

#36
post #34

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.

Unified diffs beat side-by-side the majority of the time IMO.

I disagree. I personally find side-by-side easier the majority of the time (although for some cases, unified is easier, eg when I have a single line with a word or character changed).

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

#37

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?

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

#38
post #35
post #11

Earlier quoted context omitted.

Cold dead hands won't be writing any more unreviewable code.

You can fit 120 characters side-by-side on a 1080 monitor no problem (and I regularly do)

You're assuming everyone is able to read text at the same font size as you.

The font size will likely be increased during a code review, too, depending on how the code is presented to your team.

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

#39
post #34

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.

Unified diffs beat side-by-side the majority of the time IMO.

I personally find the output of diff with the -e option most readable ;)

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

#40
post #18

Earlier quoted context omitted.

That's great if you are working alone or on a team where everyone agrees on the same editor with the same auto-wrap feature. In a mixed environment, writing code that is only readable if people choose the same tools you prefer can be a bit rude.

That cuts both ways. The most comfortable combo of a display and font size leaves me at 70 characters per line, making anything more wrap awkwardly. It wouldn't be a stretch to say that XX-chars limit only works if everyone else has tools that work best with XX.

MIME has the format=flowed option that would handle auto-wrapping text at the display width. But it requires leaving a trailing whitespace character at the end of each line that you don't want to hard-wrap (which wouldn't work well with most code linters without changing their configuration).
Post reply on HN