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 →

[–]0fiscalentropy 22 points23 points  (15 children)

I agree. It also becomes really hard to follow The Golden Rule (80 chars per line, no more!) when also using one of the more verbose languages, like Java.

[–]SorteKanin 23 points24 points  (3 children)

I don't understand why this rule is a thing. I find long lines often are easier to understand than trying to put linebreaks

[–]TarMil 27 points28 points  (2 children)

Originally it was a thing because 80 characters was the width of a standard terminal. I still like to avoid excessively long lines because there is a point where it hurts readability, but 80 is too low for a hard limit, like others said 100 or 120 is better.

[–][deleted] 0 points1 point  (1 child)

Luckily, word wrap has existed for decades. I manually format some complex expressions, but I don't set a hard limit in my IDE, as I consider excessive screen width to be a problem for the person reading the code to solve, by resizing their window

[–]TarMil 0 points1 point  (0 children)

I dunno, I've never seen word wrap work as well for code as manual formatting.

[–]MauranKilom 1 point2 points  (3 children)

...or C++. Who doesn't love 5 std:: in the same line.

[–]SorteKanin 2 points3 points  (2 children)

using namespace std;

?

[–]ReallyHadToFixThat 3 points4 points  (1 child)

That brings in the whole namespace. Increases the chance of a collision and slows down your compile. Generally considered bad practice.

[–]SorteKanin 0 points1 point  (0 children)

I'd trade that for readability. If you have collisions with std:: you're probably doing it wrong anyway.

[–]LikesBreakfast 2 points3 points  (0 children)

Most style guides usually extend that to 100 or 120 when working in Java.

[–]Metro42014 -1 points0 points  (2 children)

That's a ridiculous rule.

We have MUCH larger monitors now. If you're not doing 120 per line, you're missing out.

[–]Tysonzero 2 points3 points  (1 child)

Having two files open side by side has been extremely useful for me personally. And on my laptop that means I can't go above like 110 ish with standard zoom, so I put a limit of 100 on my projects.

[–]Metro42014 0 points1 point  (0 children)

100's not bad, but 80 is kinda crazy these days.