Re: [dwm] more consistent codestyle patch

From: Diego Biurrun <diego_AT_biurrun.de>
Date: Tue, 13 May 2008 17:52:08 +0200

On Tue, May 13, 2008 at 05:41:30PM +0200, Szabolcs Nagy wrote:
> On 5/13/08, Diego Biurrun <diego_AT_biurrun.de> wrote:
> > On Tue, May 13, 2008 at 02:05:27PM +0200, Szabolcs Nagy wrote:
> > > simple modifications (whitespce, line wrapping)
> >
> > Ummmm...
> > All of this looks like code uglification to me...
>
> well imho consistent code style is better than inconsistent
> especially if the inconsistency does not serve any purpose
>
> i don't want you to worry about it too much so here is an explanation
> of the patch:
>
> 3) use tabs for identation (even for line wraps because arg prefers this way):
> XGrabButton(dpy, AnyButton, AnyModifier, c->win, False,
> - BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
> + BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);

Well, before it was indented to align with the XGrabButton call. This
was consistently done in at least a few places and makes the code more
readable.

> 4) no extra indentation if the conditional expression of a statement wraps:
> if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
> - None, cursor[CurResize], CurrentTime) != GrabSuccess)
> + None, cursor[CurResize], CurrentTime) != GrabSuccess)

Same here, it was aligned to make it clear what expression the next line
belongs to. You kill this alignment and make this line less readable.
Putting this at the same indentation depth as the if indicates that it
is a new block after the if. Contrary to what your indentation
indicates, this is not the case.

> most of the code already followed these rules and i did not see any
> reason not to follow them in the specific cases.

I think you have misunderstood the rules the code was following.

Diego
Received on Tue May 13 2008 - 17:53:02 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:39:01 UTC