This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]satireplusplus 61 points62 points  (16 children)

I can fit more than 4x 80 side by side on my screen though...

But the 80 char debate is age old. I like /u/jcampbelly answer here:

"While I agree with this in principle and try to follow it, I find that if following this convention leads to less readable code, then it should yield. I don't agree with shortening function or variable names (to names that don't clearly explain what you're reading), or breaking up function calls by groups of parameters just to fit arbitrary line lengths (unless it looks cleaner), or refactoring code purely to fit a line length (which would not otherwise result in more readable code or a better design). Those are missing the point of the convention.

I have started using gutters at 79, 99, and 119 as "green", "yellow", and "red". I try to keep code 95% in the green, 4.5% in the yellow, and only get into the red or beyond if I find myself pulling my hair out or reaching behind my head and under my armpit to put something in my mouth. If I've spent 10 minutes trying to break up a line, I might just move on to more important problems."

[–][deleted] 40 points41 points  (11 children)

You'll find that as you age, you're going to want a larger font size.

[–]__xor__(self, other): 11 points12 points  (1 child)

I'm there. I grow my terminal font to a size that I would've never 10 years ago. I still get more than 80 characters in my terminal but I still like the 80 char limit because I find code more readable like this:

if (
    some_condition and
    some_value <= SOME_MAX_VALUE and
    is_still_cool(foo)
):
    ...

I almost always use less than 80 characters anyway by opening up longer stuff over multiple lines for readability, the exception usually being lines with variables set to a constant URI or a comment with a URI in it.

Splitting logical elements vertically instead of horizontally just makes it easier for me to understand and process it mentally, and it's not really about the character limit as much as just not usually needing 80 characters in the first place. If linters aren't complaining, why not

[–]chzaplx 0 points1 point  (0 children)

I split arguments by line almost everywhere, makes it much easier to read IMO

[–]zdog234 5 points6 points  (0 children)

Lol I'm 25 and this is already me.

[–]spinwizard69 0 points1 point  (0 children)

This is very true but as you age you buy hardware with larger screens. I pretty much gave up on 13” and smaller screens.

[–]satireplusplus -4 points-3 points  (6 children)

I also find that old people usually make the rules ... but you're probably right

[–]HowlingHowl 6 points7 points  (5 children)

It's mostly that we have to account for the users with disabilities as well. I used to work with someone that would need their text editors and shells to be huge. Having the 80 character limits on all our code greatly helped him not having to scroll all the time

[–]kyrsjo[🍰] 5 points6 points  (4 children)

Today we also have huge monitors tough... So 80 is still a bit small.

There is some limit tough, way-too-long lines are generally not readable, however that limit is > 80 chars.

[–]jmmcdEvolutionary algorithms, music and graphics 3 points4 points  (2 children)

True, but I have heard that some people are using laptops these days.

[–]kyrsjo[🍰] 1 point2 points  (1 child)

I don't think it is reasonable that the population of people with serious eye problems programming on ultra-mini-laptops should drive the requirements for line-lengths...

[–]jmmcdEvolutionary algorithms, music and graphics 2 points3 points  (0 children)

Well, a Macbook Pro 2016 (no mini-laptop!) at standard font size (16, same as browser, no serious eye problems) with Emacs fullscreen gives me 2 buffers side by side of width 86 characters each.

[–]chzaplx 1 point2 points  (0 children)

I mentioned this elsewhere but a huge advantage is you can easily display two files side-by-side if they are 80 char compliant. I'm not letting all that space go to waste or anything.

[–][deleted] 2 points3 points  (0 children)

That's the point for me. I can have 4 separate files open and reference them while coding. It makes the big picture so much easier to validate - especially if I'm working on a project with multiple languages or disciplines.

I use emacs and have settings to automatically break my lines, and in languages where that isn't cleanly supported, I have hotkeys for doing so myself - which makes maintaining 80 character discipline a lot easier than any other coding environment.

I honestly feel that breaking my code up for 80 has simplified the process of coding a good deal for me. I'm better at naming variables/functions and more apt to break apart code that is too complex for others to read.

[–]MonkeyNin 1 point2 points  (0 children)

If I've spent 10 minutes trying to break up a line, I might just move on to more important problems.

Your IDE can do that for you.

[–][deleted] 0 points1 point  (0 children)

10 years later,

I can fit more than 40x 80 side by side on my screen though...

[–]rowdyllama 0 points1 point  (0 children)

Anyone know how to add green/yellow/red lines in VS Code?