Live data from Hacker News

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

richarddingwall.name

91–100 of 180 posts

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

#91
post #70

>at a comfortable 10 point font size. How lovely for you. As someone with significantly impaired vision, even when corrected, I have my font size set to 18, thank you very much. A coding standard that assumes a 10 point font size would violate the Americans with Disabilities Act's 'reasonable accommodation' mandate. I wasn't pushy enough to act on it, but it sure pissed me off when my fellow team members blew off my…

I try and maintain 100 char width in most code, because I feel like it makes people more concise.

I’m curious on several statements you made, please take these as genuine and well intended questions:

what’s wrong with two space indent?

Would a bigger monitor with higher DPI solve some of these issues?

Have you considered a horizontal scroll wheel or similar? I think this is a Band-Aid to a bad pattern, but may be a legitimate option

You may appreciate python PEP8, which discusses things like highly nested code and functions being considered bad. I first followed PEP8 kicking and screaming, but I think it forced me to remove some bad programming habits and I now lint check my code habitually.

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

#92
post #70

>at a comfortable 10 point font size. How lovely for you. As someone with significantly impaired vision, even when corrected, I have my font size set to 18, thank you very much. A coding standard that assumes a 10 point font size would violate the Americans with Disabilities Act's 'reasonable accommodation' mandate. I wasn't pushy enough to act on it, but it sure pissed me off when my fellow team members blew off my…

So long as everyone adopts a consistent base it doesn't matter if the font ends up with the number 2 or 200, the actual size that'll appear for each user is tuned to the overall visual scale that they like best on their device.

It's one of the things that drives me nuts about shared Excel spreadsheets. Rather than just zoom in or out someone will mess with the font size to make it fit their screen and suddenly it's just screwy enough for someone else with different eyes on a different monitor when then goes to change... you get the idea.

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

#93

> formatting tennis That's a paddling. Seriously, professionals do this? If someone else wrote it and it does what it is supposed to do, it is not, NOT (no apologies for shouty emphasis), my job to change that. (I hate tabs, but will never :retab someone else's code.) My job is either/both to fix bugs and add new capabilities, not to be precious about, well, anything. I would have serious reservations about any team…

I follow the coding conventions used by the project, whether it is tabs, 4 spaces, or other preferences. For my personal projects, I use 2 spaces for indentation and maintain an 80-column width, as it fits nicely in my XTerm windows, making both code and Git commit titles and messages easy to read.

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

#94
post #11

The penultimate paragraph of the article really shows its age. When there are unclear or conflicting rules ... [y]ou can end up with hilarious games like formatting tennis ... Back then, formatters were rarely used, if at all. The major benefit of tools like gofmt, Prettier, etc. is that a major source of vacuous commits and code review has gone away. In the case of Prettier, bikeshedding can still happen over the .p…

I still play tennis with Black. But Black wins every time when I Ctrl+S. I still play tennis anyway because user-facing strings are " not '

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

#95

Earlier quoted context omitted.

IMO 120 is the extreme limit but a good limit. Anything higher than 120 is to long and, personally, I'd ask for that to be fixed in a code review.

I just bought an ultrawide, and I just checked to see how wide my lines are in my code editor. 350 characters. When I'm coding for myself, I use all of that at times. I love that there are some things I no longer have to break onto multiple lines any longer. Also, if you have a ton of nested loops etc, then you don't end up with that problem where you can only see the first few characters of the deepest lines.

Loops nested deep enough that you need an ultrawide to avoid truncated lines!?

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

#96

> formatting tennis That's a paddling. Seriously, professionals do this? If someone else wrote it and it does what it is supposed to do, it is not, NOT (no apologies for shouty emphasis), my job to change that. (I hate tabs, but will never :retab someone else's code.) My job is either/both to fix bugs and add new capabilities, not to be precious about, well, anything. I would have serious reservations about any team…

Since we’re already on a Holy War About Arbitrary Things topic (and at the risk of igniting the whitespace wars anew), do you mind expanding on this? > I hate tabs This opinion seems common but I haven’t seen a practical argument against tabs among practical arguments (for an admittedly niche situation) in favor of tabs. This seems an appropriate place to ask about it.

I simply find spaces easier to navigate. I don't always use vim-golf-winning movements, and when I am being lazy using hl or arrow keys, I expect to move a space at a time. Tabs violate that expectation.

It's a visceral rather than a rational thing (which I suppose is implied by the word "hate" :->). I also have trailing spaces and all tabs highlighted for similar reasons.

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

#97

Earlier quoted context omitted.

Since we’re already on a Holy War About Arbitrary Things topic (and at the risk of igniting the whitespace wars anew), do you mind expanding on this? > I hate tabs This opinion seems common but I haven’t seen a practical argument against tabs among practical arguments (for an admittedly niche situation) in favor of tabs. This seems an appropriate place to ask about it.

tabs are not great in Python because they can hide spaces, and that causes the code to break. in other code? i guess tabs are nicer because people can size them as they like on their devices.

I use tabs in python and it works fine, I just enable "show whitespace" in my editor.

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

#98

Earlier quoted context omitted.

IMO 120 is the extreme limit but a good limit. Anything higher than 120 is to long and, personally, I'd ask for that to be fixed in a code review.

I just bought an ultrawide, and I just checked to see how wide my lines are in my code editor. 350 characters. When I'm coding for myself, I use all of that at times. I love that there are some things I no longer have to break onto multiple lines any longer. Also, if you have a ton of nested loops etc, then you don't end up with that problem where you can only see the first few characters of the deepest lines.

In the space you use for editing a single file I can fit four 80-column source files (which I do, I also have a giant monitor).

Also, excessive nesting is almost always a code smell.

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

#99
post #54

How unfortunate that line lengths ended up being a source code concern instead of a text editor concern.

well I think the problem is that people use indentation to visually see the context of a block of code, so when you wrap text it messes that all up and if you have code with long variable names and a lot of indentation, there isn't much you can do to prevent the column from going over a certain amount of chars.

People (including torvalds) complain that some small limit like 80-chars does not make good use of screen width.

Maybe the solution in whitespace-independent code like C is just to "reset" the indentation after a certain amount, or just choose not to indent certain blocks?

I just use tabs and set my tab length to 2 or 3 chars.

IDK how text editors would adjust the source code to fit multiple screen widths. When I have a line that's too long for the line limit, I have to re-arrange the code in that line to get it under the limit.

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

#100

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.

I will do this, but only if it has many parameters.

It makes it easier to visually parse the function name, templates, outputs, etc. from the parameters than if they were all on one line

Post reply on HN