[asterisk-dev] Line length restrictions in code changes

Tzafrir Cohen tzafrir.cohen at xorcom.com
Thu Mar 16 19:12:38 CDT 2017


On Thu, Mar 16, 2017 at 02:54:32PM -0500, Matthew Jordan wrote:
> Warning: bike shedding.
> 
> On several code reviews, comments have been left along with a -1 on
> the review - indicating that it is not acceptable for merging - due to
> line length restrictions. While this is technically correct per our
> coding guidelines, it doesn't always result in the most readable code.
> 
> Personally, I find this:
> 
> if (a_good_variable_name->another_good_name &&
> do_something_to_it(a_good_variable_name->another_good_name)) {
>     // Do things
> }
> 
> To be preferable to:
> 
> if (a_good_variable_name->another_good_name
>     && do_something_to_it(a_good_variable_name->another_good_name)) {
>     // Do things
> }

I would personally prefer

if (a_good_variable_name->another_good_name &&
		do_something_to_it(a_good_variable_name->another_good_name)) {
    // Do things
}

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com



More information about the asterisk-dev mailing list