Re: coding style for long conditions (WAS: Re: [PATCH 25/90] ... blinky leds!!)

Stefan Richter
2007-04-06T21:47:11Z

David Brownell wrote:
> On Friday 06 April 2007 12:03 pm, Stefan Richter wrote:
>
>> I usually indent this way if expressions exceed the 80 columns limit:

Or in other words:
- When a new scope is opened, increase indentations by 8 characters.
Use a tab for that.
- When wrapping within an expression, start the new line at the same
column at which the (sub-)expression started.
- Deviations from the latter rule allowed if it increases readability.

> Please change your coding style to conform to Documentation/CodingStyle.

I won't change this anymore in any legacy code I write patches for. But
I also won't stand in the way of anybody who happens to submit patches
which strictly only...

> *** Only indent with tabs!! ***

...indent with tabs and change legacy code whose maintainer I am.

> Every one of those examples violates that simple rule.
>
> Why does *anyone* have even the slightest difficulty understanding such a
> simple rule?

/Does/ anybody have difficulties?

...
>> PS: Everyone please try to avoid blowing CodingStyle up to a 200 pages
>> document. Thanks.
>
> Better yet, try to stick to its guidelines rather than growing lots of
> exceptions saying when your personal style says you ought to use spaces
> instead of tabs for indents, etc

What I said at the top of this posting has not been newly grown recently
but has been common practice for many years. It's not my personal style.

(Note, I'm not saying one style is better than the other, nor am I
saying that only one style can be allowed, nor am I saying that it's
fine to have several different styles.)
--
Stefan Richter
-=====-=-=== -=-- --==-