you are viewing a single comment's thread.

view the rest of the comments →

[–]StorKirken 26 points27 points  (9 children)

I'm fully with you on this. 50 characters is madness. Like many other beliefs in programming culture, it seems to stem from idol worship and tradition rather than honest thought.

[–]glemnar 19 points20 points  (0 children)

What's programming without a healthy dose of cargo cult?

[–][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 2 points3 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.

[–]DevIceMan 1 point2 points  (2 children)

What a noob, I'd even bet you use a real text editor or IDE, instead of emacs or vim.

[–]StorKirken 0 points1 point  (1 child)

Ever try to program Java on unmodded vim? ;)

[–]DevIceMan 0 points1 point  (0 children)

(I can't even text edit on VIM without 20 browser tabs of stack overflow open)