CodingStyle indentation and alignment

Andrey Utkin andrey_utkin at fastmail.com
Tue Sep 27 10:47:13 EDT 2016


On Tue, Sep 27, 2016 at 02:27:27PM +0000, Laurence Rochfort wrote:
> Thanks very much for the comprehensive answer.
> 
> Using spaces and tabs for alignment does make the code more readable
> to my mind.
> 
> The reason behind my question originally was that the CodingStyle doc
> states:
> 
> "Outside of comments, documentation and except in Kconfig, spaces are never
> used for indentation, and the above example is deliberately broken."
> 
> however most code I have seen is not compliant with that.
> 
> Should the docs be updated?

There's difference between terms "indentation" and "alignment".
Please see paragraph "Indentation and alignment" of previously
referenced article:
http://dmitryfrank.com/articles/indent_with_tabs_align_with_spaces#indentation_and_alignment

Accounting this difference, the doc is correct in strict sense.



More information about the Kernelnewbies mailing list