Live data from Hacker News

Is the 80 character line limit still relevant? (2008)

richarddingwall.name

1–10 of 180 posts

Re: Is the 80 character line limit still relevant? (2008)

#5
One minor advantage which wasn’t so relevant in 2008: 80 character lines are much easier to read on a smartphone. This is especially true for Safari on iOS, which always seems to make bad wrapping / sizing decisions with plain text.

ETA: thinking back on it, several years ago I switched from 120 characters to 80 specifically because of this. I don’t have a car, so I read a lot of code on my phone while taking public transit.

Re: Is the 80 character line limit still relevant? (2008)

#6

One minor advantage which wasn’t so relevant in 2008: 80 character lines are much easier to read on a smartphone. This is especially true for Safari on iOS, which always seems to make bad wrapping / sizing decisions with plain text. ETA: thinking back on it, several years ago I switched from 120 characters to 80 specifically because of this. I don’t have a car, so I read a lot of code on my phone while taking public…

Someone else is going to be weird and want to look this up so I'll save you the trouble.

Yes, aithrowawaycomm's claim about line lengths are supported by many, many different sources who recommend a 50 to 80 character line length.

https://duckduckgo.com/?q=reading+optimal+line+length

IMHO, 80 characters is too narrow, especially with Python, for most coding tasks so I settle more around 100 (+-20) characters. PEP-8 says up to 99 characters is okay.

https://peps.python.org/pep-0008/#maximum-line-length

Re: Is the 80 character line limit still relevant? (2008)

#8

I think 110 is a nice spot. You can still split screen but also fit a lot of content on one line

Honestly it depends of the language you're writing in too.

Some language are just long and wordy and having a 'fixed' size just leads to awkward line splits. e.g. all the languages that tend to favour 2 space tabs.

Re: Is the 80 character line limit still relevant? (2008)

#9

One minor advantage which wasn’t so relevant in 2008: 80 character lines are much easier to read on a smartphone. This is especially true for Safari on iOS, which always seems to make bad wrapping / sizing decisions with plain text. ETA: thinking back on it, several years ago I switched from 120 characters to 80 specifically because of this. I don’t have a car, so I read a lot of code on my phone while taking public…

Took me a second to realize ETA was "edited to add." I was very confused on what an estimated time of arrival meant, here. :)

I'm surprised reading on a phone is common. Not at all something I would want to do. I'm assuming largely read only there?

Makes me curious if the CWEB idea of styling specifically for reading has extra merit in that flow?

Re: Is the 80 character line limit still relevant? (2008)

#10
I use 120 or 132 (no idea why I picked that number), but I tend to break my lines well before that, especially on function signatures.

I'm that git that puts each param on a separate line (so I can quickly comment them out when I need to). It annoys other programmers, but once I explain why ...

They're still annoyed, but at least they're quiet about it.

Post reply on HN