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

Philip Brown
2003-08-11T19:11:49Z

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)