Re: condingstyle, was Re: utrace comments

2007-05-02 Thread David Howells
Eric W. Biederman <[EMAIL PROTECTED]> wrote: > > But the condition doesn't line up with the code: > > Exactly. The condition not lining up with the following code helps > code helps separate the two. Sorry about that: I realised you were agreeing with me about 5s after I sent the message. >

Re: condingstyle, was Re: utrace comments

2007-05-02 Thread Eric W. Biederman
David Howells <[EMAIL PROTECTED]> writes: > Eric W. Biederman <[EMAIL PROTECTED]> wrote: > >> Not lining up with the code following the if statement is also >> a plus. Because it clearly delineates the conditions from the code. > > But the condition doesn't line up with the code: Exactly. The

Re: condingstyle, was Re: utrace comments

2007-05-02 Thread David Howells
Eric W. Biederman <[EMAIL PROTECTED]> wrote: > Not lining up with the code following the if statement is also > a plus. Because it clearly delineates the conditions from the code. But the condition doesn't line up with the code: if (veryverylengthycondition1 && smallcond2

Re: condingstyle, was Re: utrace comments

2007-05-02 Thread David Howells
Eric W. Biederman [EMAIL PROTECTED] wrote: Not lining up with the code following the if statement is also a plus. Because it clearly delineates the conditions from the code. But the condition doesn't line up with the code: if (veryverylengthycondition1 smallcond2

Re: condingstyle, was Re: utrace comments

2007-05-02 Thread Eric W. Biederman
David Howells [EMAIL PROTECTED] writes: Eric W. Biederman [EMAIL PROTECTED] wrote: Not lining up with the code following the if statement is also a plus. Because it clearly delineates the conditions from the code. But the condition doesn't line up with the code: Exactly. The condition

Re: condingstyle, was Re: utrace comments

2007-05-02 Thread David Howells
Eric W. Biederman [EMAIL PROTECTED] wrote: But the condition doesn't line up with the code: Exactly. The condition not lining up with the following code helps code helps separate the two. Sorry about that: I realised you were agreeing with me about 5s after I sent the message. However

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread Eric W. Biederman
David Howells <[EMAIL PROTECTED]> writes: > John Anthony Kazos Jr. <[EMAIL PROTECTED]> wrote: > >> if (veryverylengthycondition1 >> && smallcond2 >> && (conditionnumber3a >> || condition3b)) { >> ... >> } >> >> Clear, crisp,

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread Satyam Sharma
On 5/1/07, David Woodhouse <[EMAIL PROTECTED]> wrote: On Tue, 2007-05-01 at 08:05 -0700, Randy Dunlap wrote: > I prefer this format also, but I'm not sure that we can get it > into CodingStyle. CodingStyle is about (either) concensus or > dictum, but I don't see us close to concensus... Yes,

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread Satyam Sharma
On 5/1/07, John Anthony Kazos Jr. <[EMAIL PROTECTED]> wrote: > It's horrid. I'd much rather see > > if (veryverylengthycondition1 && > smallcond2 && > (conditionnumber3a || condition3b)) { > ... > } if (veryverylengthycondition1

RE: condingstyle, was Re: utrace comments

2007-05-01 Thread Stuart MacDonald
From: On Behalf Of Satyam Sharma > readable and obvious at first glance itself. For example, consider: ^^^ > > if (veryverylengthycondition1 && > smallcond2 && > (conditionnumber3a || > condition3b)) { >

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread David Howells
John Anthony Kazos Jr. <[EMAIL PROTECTED]> wrote: > if (veryverylengthycondition1 > && smallcond2 > && (conditionnumber3a > || condition3b)) { > ... > } > > Clear, crisp, and 80-wide. I also like how the logical operator

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread David Woodhouse
On Tue, 2007-05-01 at 17:07 +0200, Geert Uytterhoeven wrote: > For clarity, if it fits, I prefer that one, too. I don't think that was under question, was it? My point was that I prefer it even when it _doesn't_ fit. -- dwmw2 - To unsubscribe from this list: send the line "unsubscribe

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread Randy Dunlap
On Tue, 01 May 2007 15:16:13 +0100 David Woodhouse wrote: > On Tue, 2007-05-01 at 11:00 +0200, Geert Uytterhoeven wrote: > > > > if (veryverylengthycondition1 && > > smallcond2 && > > (conditionnumber3a || > > condition3b)) { > > ... >

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread David Woodhouse
On Tue, 2007-05-01 at 08:05 -0700, Randy Dunlap wrote: > I prefer this format also, but I'm not sure that we can get it > into CodingStyle. CodingStyle is about (either) concensus or > dictum, but I don't see us close to concensus... CodingStyle is mostly about consensus. We don't have a

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread Geert Uytterhoeven
On Tue, 1 May 2007, David Woodhouse wrote: > On Tue, 2007-05-01 at 11:00 +0200, Geert Uytterhoeven wrote: > > > > if (veryverylengthycondition1 && > > smallcond2 && > > (conditionnumber3a || > > condition3b)) { > > ... > > } >

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread John Anthony Kazos Jr.
> > if (veryverylengthycondition1 && > > smallcond2 && > > (conditionnumber3a || > > condition3b)) { > > ... > > } > > It's horrid. I'd much rather see > > if (veryverylengthycondition1 && > smallcond2 && >

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread David Woodhouse
On Tue, 2007-05-01 at 11:00 +0200, Geert Uytterhoeven wrote: > > if (veryverylengthycondition1 && > smallcond2 && > (conditionnumber3a || > condition3b)) { > ... > } It's horrid. I'd much rather see if

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread Scott Preece
On 5/1/07, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: On Tue, 1 May 2007, Satyam Sharma wrote: > Actually, the latter style (one condition per line and the && or || > operators appearing _before_ the conditions in subsequent lines) > is quite popular for multi-line compound conditions (well,

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread Geert Uytterhoeven
On Tue, 1 May 2007, Satyam Sharma wrote: > Actually, the latter style (one condition per line and the && or || > operators appearing _before_ the conditions in subsequent lines) > is quite popular for multi-line compound conditions (well, I've seen this > in kernel/workqueue.c,

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread Geert Uytterhoeven
On Tue, 1 May 2007, Satyam Sharma wrote: Actually, the latter style (one condition per line and the or || operators appearing _before_ the conditions in subsequent lines) is quite popular for multi-line compound conditions (well, I've seen this in kernel/workqueue.c, kernel/stop_machine.c,

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread Scott Preece
On 5/1/07, Geert Uytterhoeven [EMAIL PROTECTED] wrote: On Tue, 1 May 2007, Satyam Sharma wrote: Actually, the latter style (one condition per line and the or || operators appearing _before_ the conditions in subsequent lines) is quite popular for multi-line compound conditions (well, I've

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread David Woodhouse
On Tue, 2007-05-01 at 11:00 +0200, Geert Uytterhoeven wrote: if (veryverylengthycondition1 smallcond2 (conditionnumber3a || condition3b)) { ... } It's horrid. I'd much rather see if (veryverylengthycondition1

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread John Anthony Kazos Jr.
if (veryverylengthycondition1 smallcond2 (conditionnumber3a || condition3b)) { ... } It's horrid. I'd much rather see if (veryverylengthycondition1 smallcond2

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread David Woodhouse
On Tue, 2007-05-01 at 08:05 -0700, Randy Dunlap wrote: I prefer this format also, but I'm not sure that we can get it into CodingStyle. CodingStyle is about (either) concensus or dictum, but I don't see us close to concensus... CodingStyle is mostly about consensus. We don't have a

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread Geert Uytterhoeven
On Tue, 1 May 2007, David Woodhouse wrote: On Tue, 2007-05-01 at 11:00 +0200, Geert Uytterhoeven wrote: if (veryverylengthycondition1 smallcond2 (conditionnumber3a || condition3b)) { ... } It's horrid. I'd

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread Randy Dunlap
On Tue, 01 May 2007 15:16:13 +0100 David Woodhouse wrote: On Tue, 2007-05-01 at 11:00 +0200, Geert Uytterhoeven wrote: if (veryverylengthycondition1 smallcond2 (conditionnumber3a || condition3b)) { ... }

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread David Woodhouse
On Tue, 2007-05-01 at 17:07 +0200, Geert Uytterhoeven wrote: For clarity, if it fits, I prefer that one, too. I don't think that was under question, was it? My point was that I prefer it even when it _doesn't_ fit. -- dwmw2 - To unsubscribe from this list: send the line unsubscribe

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread David Howells
John Anthony Kazos Jr. [EMAIL PROTECTED] wrote: if (veryverylengthycondition1 smallcond2 (conditionnumber3a || condition3b)) { ... } Clear, crisp, and 80-wide. I also like how the logical operator on the

RE: condingstyle, was Re: utrace comments

2007-05-01 Thread Stuart MacDonald
From: On Behalf Of Satyam Sharma readable and obvious at first glance itself. For example, consider: ^^^ if (veryverylengthycondition1 smallcond2 (conditionnumber3a || condition3b)) { ...

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread Satyam Sharma
On 5/1/07, John Anthony Kazos Jr. [EMAIL PROTECTED] wrote: It's horrid. I'd much rather see if (veryverylengthycondition1 smallcond2 (conditionnumber3a || condition3b)) { ... } if (veryverylengthycondition1

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread Satyam Sharma
On 5/1/07, David Woodhouse [EMAIL PROTECTED] wrote: On Tue, 2007-05-01 at 08:05 -0700, Randy Dunlap wrote: I prefer this format also, but I'm not sure that we can get it into CodingStyle. CodingStyle is about (either) concensus or dictum, but I don't see us close to concensus... Yes, some

Re: condingstyle, was Re: utrace comments

2007-05-01 Thread Eric W. Biederman
David Howells [EMAIL PROTECTED] writes: John Anthony Kazos Jr. [EMAIL PROTECTED] wrote: if (veryverylengthycondition1 smallcond2 (conditionnumber3a || condition3b)) { ... } Clear, crisp, and 80-wide. I also like

Re: condingstyle, was Re: utrace comments

2007-04-30 Thread Stefan Richter
Satyam Sharma wrote: [...] > The rationale is to make the operator prominent and thus make > the structure of a complex multi-line compound conditional expression more > readable and obvious at first glance itself. For example, consider: > > if (veryverylengthycondition1 && >

RE: condingstyle, was Re: utrace comments

2007-04-30 Thread Luck, Tony
> I'm a bit lost here. Are we referring to > > if (expr) { > ... > } else { > ... > } > > versus > > if (expr) { > ... > } > else { > ... > } This one is already covered by Documentation/CodingStyle

Re: condingstyle, was Re: utrace comments

2007-04-30 Thread Satyam Sharma
Hi, On 4/30/07, Andrew Morton <[EMAIL PROTECTED]> wrote: On Mon, 30 Apr 2007 10:11:21 +0100 Christoph Hellwig <[EMAIL PROTECTED]> wrote: > I've separated this out under a new subject because some style issues > that so far aren't documented explicitly are in doubt here, and Roland > wants and

Re: condingstyle, was Re: utrace comments

2007-04-30 Thread Daniel Hazelton
On Monday 30 April 2007 13:09:17 Andrew Morton wrote: > On Mon, 30 Apr 2007 10:11:21 +0100 Christoph Hellwig <[EMAIL PROTECTED]> wrote: > > I've separated this out under a new subject because some style issues > > that so far aren't documented explicitly are in doubt here, and Roland > > wants

Re: condingstyle, was Re: utrace comments

2007-04-30 Thread Jan Engelhardt
On Apr 30 2007 10:09, Andrew Morton wrote: > >This is > > if (expr1 && > expr2) > >versus > > if (expr1 > && expr2) > >the former is more common and is, IMO, more readable. > >The latter can be handy sometimes to prevent an 80-col overflow in the >first

Re: condingstyle, was Re: utrace comments

2007-04-30 Thread Andrew Morton
On Mon, 30 Apr 2007 10:11:21 +0100 Christoph Hellwig <[EMAIL PROTECTED]> wrote: > I've separated this out under a new subject because some style issues > that so far aren't documented explicitly are in doubt here, and Roland > wants and Answer from Andrew. > > We also should put clauses on this

Re: condingstyle, was Re: utrace comments

2007-04-30 Thread Andrew Morton
On Mon, 30 Apr 2007 10:11:21 +0100 Christoph Hellwig [EMAIL PROTECTED] wrote: I've separated this out under a new subject because some style issues that so far aren't documented explicitly are in doubt here, and Roland wants and Answer from Andrew. We also should put clauses on this into

Re: condingstyle, was Re: utrace comments

2007-04-30 Thread Jan Engelhardt
On Apr 30 2007 10:09, Andrew Morton wrote: This is if (expr1 expr2) versus if (expr1 expr2) the former is more common and is, IMO, more readable. The latter can be handy sometimes to prevent an 80-col overflow in the first line. But reads like

Re: condingstyle, was Re: utrace comments

2007-04-30 Thread Daniel Hazelton
On Monday 30 April 2007 13:09:17 Andrew Morton wrote: On Mon, 30 Apr 2007 10:11:21 +0100 Christoph Hellwig [EMAIL PROTECTED] wrote: I've separated this out under a new subject because some style issues that so far aren't documented explicitly are in doubt here, and Roland wants and Answer

Re: condingstyle, was Re: utrace comments

2007-04-30 Thread Satyam Sharma
Hi, On 4/30/07, Andrew Morton [EMAIL PROTECTED] wrote: On Mon, 30 Apr 2007 10:11:21 +0100 Christoph Hellwig [EMAIL PROTECTED] wrote: I've separated this out under a new subject because some style issues that so far aren't documented explicitly are in doubt here, and Roland wants and Answer

RE: condingstyle, was Re: utrace comments

2007-04-30 Thread Luck, Tony
I'm a bit lost here. Are we referring to if (expr) { ... } else { ... } versus if (expr) { ... } else { ... } This one is already covered by Documentation/CodingStyle (with the

Re: condingstyle, was Re: utrace comments

2007-04-30 Thread Stefan Richter
Satyam Sharma wrote: [...] The rationale is to make the operator prominent and thus make the structure of a complex multi-line compound conditional expression more readable and obvious at first glance itself. For example, consider: if (veryverylengthycondition1 smallcond2