if block style when condition spams to multiple lines.

Daniel. danielhilst at gmail.com
Thu May 19 14:07:10 EDT 2016


What is the preferred way to ident if statement when the condition
spams to multiple lines, ex:

if (cond1 &&
    cond2 &&
    cond3) {
        ...
        ...
}

or

if (cond1 &&
    cond2 &&
    cond3)
{
   ...
   ...
}

or if only one statement inside body

if (cond1 &&
    cond2 &&
    cond3
        ...

Also, usualy, I align the remaining lines from codition to one
column after the parenthesis that starts the condition and usually
I need spaces to do that. Is that okay? With no spaces would be:
if (cond1 &&
        cond2)
{
        ...

Regards,
-- 
*"Do or do not. There is no try"*
  *Yoda Master*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160519/193315c5/attachment.html 


More information about the Kernelnewbies mailing list