Re: [Dri-devel] Re: [PATCH] CodingStyle fixes for drm_agpsupport

From: Philip Brown
Date: Mon Aug 11 2003 - 14:19:53 EST


On Mon, Aug 11, 2003 at 10:59:41AM -0700, Larry McVoy wrote:
>...
> It is inconsistent, on purpose. It's essentially like perl's
>
> return unless pointer;
>
> which is a oneliner, almost like an assert().

perl is EEeeeeevil....



> Maybe this will help: I insist on braces on anything with indentation so
> that I can scan them more quickly. If I gave you a choice between
>
> if (!pointer) {
> return (whatever);
> }
>
> if (!pointer) return (whatever);
>
> which one will you type more often?


if (!pointer) {
return (whatever);
}


because it's consistent, and guaranteed safe from stupid parsing errors
that can waste days of debug time when someone decides to add to it.
("its just a little change that cant hurt anything", ha ha)


Style Matters. (and so do comments, while we're on the subject)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/