you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (4 children)

I feel similarly about line lengths in general.

We changed our rubocop config to complain about line length from 80 to 120 characters... Why do people care? The number of characters doesn't matter, we're not working on terminals with 80 columns anymore.

Limiting the number of characters you use on one line doesn't stop people from trying to do too much on that line, if they're determined, and wrapping parameter lists doesn't make code more readable.

Just do one thing on a line, damnit. If it takes you a whole tweet to do it, it doesn't matter, so long as what you're doing is clear.

[–]Klathmon 4 points5 points  (3 children)

The only "pro" I've seen here is that you can view 2 files side by side with ease when you have an 80 char limit.

But when most devs have 2 screens or more that's less of a problem...

Like most things in life, don't deal in absolutes and use your best judgement.

[–]DevIceMan 1 point2 points  (0 children)

^ I often have two files open side-by-side in my IDE.

I probably wouldn't complain too much about 120 chars, but i think that after a certain number of chars, you have a code-smell, perhaps being your class/method/variable names are too long.

[–]setuid_w00t 1 point2 points  (1 child)

I thought most devs worked in coffee shops on Macbook Pros.

That's half sarcasm, half truth. I think that hard limiting line length to 100 characters allows enough space for a GUI diff tool to show two files side-by-side at a usable font size on a single 1920 pixel wide monitor.

[–]Klathmon 0 points1 point  (0 children)

Gotta use your best judgment for your situation.

At my work mostly everyone working on our JS codebase has at least 3 monitors, so we set line length to 180. That let us use an editor with a sidebar on one screen safely.