Re: if block style when condition spams to multiple lines.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 19, 2016 at 9:07 PM, Daniel. <danielhilst@xxxxxxxxx> wrote:
> What is the preferred way to ident if statement when the condition
> spams to multiple lines, ex:
>
> if (cond1 &&
>     cond2 &&
>     cond3) {
>         ...
>         ...
> }

^ this one is preferred.

>
> 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
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux