Re: Merging of completely unreviewed drivers

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Newall <davidn@...>
Cc: Pavel Machek <pavel@...>, Krzysztof Halasa <khc@...>, Jeff Garzik <jeff@...>, Adrian Bunk <bunk@...>, Roland Dreier <rdreier@...>, Glenn Streiff <gstreiff@...>, Faisal Latif <flatif@...>, <linux-kernel@...>, <general@...>, Andrew Morton <akpm@...>, Greg Kroah-Hartman <greg@...>
Date: Saturday, February 23, 2008 - 1:33 pm

On Sat, 23 Feb 2008, David Newall wrote:

Do people really care that deeply?

I still sometimes use small terminal windows - for a while I had my 
default terminal come up as 100x40, but I'm back to the standard 80x24, 
and while I often resize them, I certainly don't always.

And do I find lines longer than 80 charactes unreadable? Hell no.

Quite frankly, on a 80x24 display, I'll take long lines over split-up ones 
*any* day. For things like doing "git grep xyzzy", I'd *much* rather get 
the occasional long line that wraps (or, if I'm in "less -S", that I have 
to press right-arrow to see), than see just a meaningless fragment because 
somebody decided that they should always fit in 80 characters.

So *consistently* long lines are the problem, not the occasional one. The 
occasional one is likely more readable as it is, than split up.

Here's an example from code that actually looks pretty good in general:

	static unsigned long
	calc_delta_mine(unsigned long delta_exec, unsigned long weight,
	                struct load_weight *lw)

and look around that function in general: it's doesn't match the coding 
standard, but also compare the output of

	git grep calc_delta_mine

with the output of something like

	git grep update_load_sub

which actually shows you what the calling convention is.

So putting that long function definition on one line would make it a
108-character line or somethign like that, but it would have advantages
too.  It would have advantages for anything that is line-based (I use
grep for *everything*, but maybe I'm just odd), but it would also
actually be more readable for the people who have bigger windows.

But my point is, some of those advantages remain even with small
terminals, and quite often the downsides aren't even all that huge. 
Most editors wrap or chop the line according to your preferences (mine
are personally to chop), and if it's a fairly uncommon thing, those
downsides shrink further. 

Is 108 characters perhaps *too* long? In the above case it probably is,
since the downside of splitting the patch is pretty small (it's a static
function, only used in that file, the "grep" argument is weak, yadda
yadda).  But I'm just saying that it's not 100% obvious *even*if* you're
on a 80x24 terminal, and in some other cases the downside of splitting
the line can be much bigger (strings or more spread-out function calls
and declarations etc). 

The line length problem would probably be better attacked as something
more akin to the rule

 - do a rolling window of <n> last non-empty lines (n ~ 15 or so)

 - if more than <m> of those lines were longer than 72 charactes,
   somethign is wrong (m ~ 5 or so). 

which talks more about what matters - too deep indentation. And also 
attacks the problem that is really relevant: it's that kind of code that 
ends up being unreadable because so *much* of it is cut off or wrapped.

			Linus

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Merging of completely unreviewed drivers, Adrian Bunk, (Thu Feb 21, 5:01 pm)
Re: Merging of completely unreviewed drivers, Arjan van de Ven, (Thu Feb 21, 6:08 pm)
Re: Merging of completely unreviewed drivers, Pavel Machek, (Fri Feb 22, 2:40 pm)
Re: Merging of completely unreviewed drivers, Jeff Garzik, (Thu Feb 21, 6:33 pm)
Re: Merging of completely unreviewed drivers, Adrian Bunk, (Thu Feb 21, 7:40 pm)
Re: Merging of completely unreviewed drivers, Greg KH, (Thu Feb 21, 5:30 pm)
Re: Merging of completely unreviewed drivers, Adrian Bunk, (Thu Feb 21, 9:06 pm)
Re: Merging of completely unreviewed drivers, Linus Torvalds, (Thu Feb 21, 5:14 pm)
Re: Merging of completely unreviewed drivers, Ingo Molnar, (Fri Feb 22, 2:54 pm)
Re: Merging of completely unreviewed drivers, Jeff Garzik, (Fri Feb 22, 3:20 pm)
Re: Merging of completely unreviewed drivers, Greg KH, (Fri Feb 22, 3:44 pm)
Re: Merging of completely unreviewed drivers, Krzysztof Halasa, (Thu Feb 21, 7:38 pm)
Re: Merging of completely unreviewed drivers, David Newall, (Thu Feb 21, 9:46 pm)
Re: [ofa-general] Re: Merging of completely unreviewed drivers, John W. Linville, (Fri Feb 22, 11:48 am)
Re: [ofa-general] Re: Merging of completely unreviewed drivers, John W. Linville, (Fri Feb 22, 12:48 pm)
Re: Merging of completely unreviewed drivers, Al Viro, (Thu Feb 21, 10:06 pm)
Re: Merging of completely unreviewed drivers, Linus Torvalds, (Thu Feb 21, 11:13 pm)
Re: Merging of completely unreviewed drivers, Krzysztof Halasa, (Fri Feb 22, 6:37 pm)
Re: Merging of completely unreviewed drivers, Ray Lee, (Fri Feb 22, 2:37 am)
Re: Merging of completely unreviewed drivers, Jan Engelhardt, (Sat Feb 23, 11:31 am)
Re: Merging of completely unreviewed drivers, David Newall, (Sat Feb 23, 11:22 pm)
Re: Merging of completely unreviewed drivers, Krzysztof Halasa, (Thu Feb 21, 10:23 pm)
Re: Merging of completely unreviewed drivers, Al Viro, (Thu Feb 21, 11:13 pm)
Re: Merging of completely unreviewed drivers, Krzysztof Halasa, (Fri Feb 22, 6:28 pm)
Re: Merging of completely unreviewed drivers, Jörn, (Sun Feb 24, 3:47 am)
Re: Merging of completely unreviewed drivers, Krzysztof Halasa, (Sun Feb 24, 10:47 am)
Re: Merging of completely unreviewed drivers, Alan Cox, (Thu Feb 21, 7:31 pm)
Re: Merging of completely unreviewed drivers, Adrian Bunk, (Thu Feb 21, 8:29 pm)
Re: Merging of completely unreviewed drivers, Jeff Garzik, (Thu Feb 21, 7:41 pm)
Re: Merging of completely unreviewed drivers, Krzysztof Halasa, (Thu Feb 21, 8:05 pm)
Re: Merging of completely unreviewed drivers, Pavel Machek, (Fri Feb 22, 2:45 pm)
Re: Merging of completely unreviewed drivers, Krzysztof Halasa, (Fri Feb 22, 6:44 pm)
Re: Merging of completely unreviewed drivers, Pavel Machek, (Sat Feb 23, 5:43 am)
Re: Merging of completely unreviewed drivers, Krzysztof Halasa, (Sat Feb 23, 9:58 am)
Re: Merging of completely unreviewed drivers, David Newall, (Sat Feb 23, 8:38 am)
Re: Merging of completely unreviewed drivers, Linus Torvalds, (Sat Feb 23, 1:33 pm)
Re: Merging of completely unreviewed drivers, David Newall, (Sat Feb 23, 11:26 pm)
Re: Merging of completely unreviewed drivers, Linus Torvalds, (Sun Feb 24, 12:47 am)
Re: Merging of completely unreviewed drivers, Pavel Machek, (Sat Feb 23, 11:25 am)
Re: Merging of completely unreviewed drivers, David Newall, (Sat Feb 23, 11:18 pm)
Re: Merging of completely unreviewed drivers, Alan Cox, (Fri Feb 22, 6:04 am)
Re: Merging of completely unreviewed drivers, Jeff Garzik, (Thu Feb 21, 8:44 pm)
Re: Merging of completely unreviewed drivers, Krzysztof Halasa, (Thu Feb 21, 10:02 pm)
Re: Merging of completely unreviewed drivers, Alexey Dobriyan, (Thu Feb 21, 6:33 pm)
Re: Merging of completely unreviewed drivers, Greg KH, (Thu Feb 21, 6:43 pm)
Re: Merging of completely unreviewed drivers, Jan Engelhardt, (Thu Feb 21, 7:31 pm)
Re: Merging of completely unreviewed drivers, Alexey Dobriyan, (Thu Feb 21, 6:58 pm)
Re: Merging of completely unreviewed drivers, Jeff Garzik, (Thu Feb 21, 6:57 pm)
Re: Merging of completely unreviewed drivers, Roland Dreier, (Thu Feb 21, 5:09 pm)