News for hackers. Stuff that matters.
Re:Software Engineering at Google (2020) [pdf] by maskedinvader on Wednesday May 04, 2022 @02:02AM (#31257197)
do we really have to limit 80 chars now? don't we all have bigger monitors and wider screens to accommodate 120 perhaps?
Re:Software Engineering at Google (2020) [pdf] by omegalulw on Wednesday May 04, 2022 @02:18AM (#31257291)
Other than the reasons already posted, I find it much easier to read code with 80 char line limits vs longer. For me it's like the benefit of reading an article in columnar format - going down vertically just feels more comfortable.
Re:Software Engineering at Google (2020) [pdf] by helge9210 on Wednesday May 04, 2022 @02:05AM (#31257212)
With 80 chars you could fit three windows with code side by side on standard screen or four on ultra wide.
Re:Software Engineering at Google (2020) [pdf] by nicogg88 on Wednesday May 04, 2022 @06:09AM (#31258514)
When you take into account IDE stuff like file tree on the left, plugins on the right, or the split view when looking at a file diff, more than 80 char is too much even on a large monitor in my opinion.
Re:Software Engineering at Google (2020) [pdf] by corford on Wednesday May 04, 2022 @05:17AM (#31258277)
Even Linus seems comfortable with 100 these days: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...

On my team we've settled for either 100 or 120 depending on language.

Re:Software Engineering at Google (2020) [pdf] by BeetleB on Wednesday May 04, 2022 @01:04PM (#31263109)
I almost always have multiple files open side by side. Lines longer than 100 characters start wrapping which really hurts readability.
Re:Software Engineering at Google (2020) [pdf] by LudwigNagasena on Wednesday May 04, 2022 @02:06AM (#31257219)
Don’t we all have IDEs that enumerate lines and allow wrapping?
Re:Software Engineering at Google (2020) [pdf] by okamiueru on Wednesday May 04, 2022 @02:50AM (#31257483)
Not sure what you mean. Soft wrapping?
Re:Software Engineering at Google (2020) [pdf] by dmitriid on Wednesday May 04, 2022 @02:04AM (#31257208)
On a wider screen you will probably have several code windows/panes side by side. So, back to 80 characters :)
Re:Software Engineering at Google (2020) [pdf] by nickjj on Wednesday May 04, 2022 @08:08AM (#31259354)
Yep.

If you run 2560x1440 at its native resolution you can fit (4) side by side code windows at 80 characters with a very readable font size. Having 120 character lines only lets you have 2 (3 will cut off the last one by a decent amount).

Being able to comfortably open 4 files side by side is like having access to a completely new world compared to 2. You can often fit the entire context of what you're working on in one visible space.

I use 80 characters for mainly this reason and it's also no extra time spent when using languages like Python because Black will auto-format it for you, it comes down to running 1 command and letting the machine do all of the work.

Re:Software Engineering at Google (2020) [pdf] by ignoramous on Wednesday May 04, 2022 @02:19AM (#31257296)
While it might be true that 120 chars are ideal for screens [0], the consensus is an optimal line length is roughly 50 to 75 chars. [1]

[0] https://www.viget.com/articles/the-line-length-misconception...

[1] http://webtypography.net/2.1.2

Re:Software Engineering at Google (2020) [pdf] by kitsune_ on Wednesday May 04, 2022 @03:11AM (#31257628)
Yeah but line formatting usually includes white space indentation in the calculation of the line length, I don't know whether you can 1:1 translate findings from normal text paragraphs like that. With linted code the actual relevant length might only be 20 characters, maybe we need some smarter linters.
Re:Software Engineering at Google (2020) [pdf] by kozd on Wednesday May 04, 2022 @02:22AM (#31257323)
That seems to apply for blocks of text. I don't know that the same would hold true for code.
Re:Software Engineering at Google (2020) [pdf] by shakezula on Wednesday May 04, 2022 @02:34AM (#31257407)
What is code if not blocks of text
Re:Software Engineering at Google (2020) [pdf] by YokoZar on Wednesday May 04, 2022 @06:50AM (#31258752)
Sentences feel different from lines of code. "One statement doing one thing per line of code" seems a reasonable idea but "one sentence per line of text" seems a bit absurd.
Re:Software Engineering at Google (2020) [pdf] by tpush on Wednesday May 04, 2022 @02:46AM (#31257467)
A tree of nodes.
Re:Software Engineering at Google (2020) [pdf] by shakezula on Wednesday May 04, 2022 @08:57PM (#31268039)
And we model sentences the same way
Re:Software Engineering at Google (2020) [pdf] by cjg on Wednesday May 04, 2022 @06:43AM (#31258700)
Often significantly more indented.