News for hackers. Stuff that matters.
Re:Linus on Line Breaks (2020) by coldtea on Sunday November 28, 2021 @01:36PM (#29371516)
That's for books.

When reading code, I'd rather see a single statement on one line, rather that break it at 2 lines because it passed some ancient 80 char limit...

Re:Linus on Line Breaks (2020) by nomercy400 on Sunday November 28, 2021 @04:14PM (#29373107)
Thank you. I was looking for this.

I don't care if a line needs to be 180 chars if it starts with log.debug. Just like searching, I read my code globally based on the first 10-20 chars. If I need details on a line, I'll read the whole line.

I do however put chained methods on new lines, because they are often a new statement.

And I use 4 spaces for indent, because my IDE is smart enough, it is in my programming language guidelines, and that's what my comapny uses.

Re:Linus on Line Breaks (2020) by thow_away_soon on Sunday November 28, 2021 @04:20PM (#29373164)
I'd rather not have that statement more than 80 char long; that might be a one liner where many things are happening, in case there _is_ value is breaking it up, or maybe the variable names are too long, not helping readability.
Re:Linus on Line Breaks (2020) by rocqua on Sunday November 28, 2021 @04:42PM (#29373329)
Long variable names can cause long lines.

So can simple arithmetic that would be worse with intermediate values.

Re:Linus on Line Breaks (2020) by d0mine on Sunday November 28, 2021 @02:34PM (#29372122)
"ancient" doesn't mean wrong. Round wheels are ancient, it doesn't mean we should switch to the square wheels.
Re:Linus on Line Breaks (2020) by coldtea on Sunday November 28, 2021 @03:37PM (#29372736)
>Round wheels are ancient, it doesn't mean we should switch to the square wheels.

No, but it means we better use rubber wheels, not stone ones...

Re:Linus on Line Breaks (2020) by cortesoft on Sunday November 28, 2021 @02:53PM (#29372300)
It doesn't mean right either, and the person you are responding to gave specific reasons why they prefer longer.
Re:Linus on Line Breaks (2020) by kortilla on Sunday November 28, 2021 @03:03PM (#29372379)
So it’s almost as if the “ancient” qualifier was useless.
Re:Linus on Line Breaks (2020) by cortesoft on Sunday November 28, 2021 @03:14PM (#29372495)
Well it was clearly meant to imply that the reason we are using it is merely tradition, and that there was a reason a long time ago that no longer applies.
Re:Linus on Line Breaks (2020) by coldtea on Sunday November 28, 2021 @03:37PM (#29372741)
It was intended to mean "relavent in old times".
Re:Linus on Line Breaks (2020) by mayoff on Sunday November 28, 2021 @05:26PM (#29373741)
And we all use 80-column wheels because that's what the ancients used, by Zeus!

Oh wait, we use wheels sized for their use cases…

Re:Linus on Line Breaks (2020) by jlarocco on Sunday November 28, 2021 @06:53PM (#29374585)
Re:Linus on Line Breaks (2020) by hsbauauvhabzb on Sunday November 28, 2021 @05:23PM (#29373705)
We also shouldn’t burn people deemed witches at the stake. Being ancient doesn’t make it right, either.