Re: [PATCH 7/8] CodingGuidelines: on comparison

2014-05-02 Thread Junio C Hamano
Jeff King  writes:

> I meant something even less in-depth. Your message says only "on
> comparison", and I did not even know what "this" in your sentence above
> would mean until I followed the link.
>
>   There are arguments for writing a conditional as "a < b" rather than
>   "b > a", or vice versa. Let's give guidance on which we prefer.
>
> Not a big deal, but I think it is easy when you have just written the
> patch to forget that a reviewer or a reader of "git log" six months have
> no has no context at all.

Thanks; I'll steal that one.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 7/8] CodingGuidelines: on comparison

2014-05-02 Thread Jeff King
On Fri, May 02, 2014 at 11:18:34AM -0700, Junio C Hamano wrote:

> Jeff King  writes:
> 
> > On Wed, Apr 30, 2014 at 02:45:11PM -0700, Junio C Hamano wrote:
> >
> >> See http://thread.gmane.org/gmane.comp.version-control.git/3903/focus=4126
> >> 
> >> Signed-off-by: Junio C Hamano 
> >
> > Don't you often complain about submitters referencing a discussion
> > in a commit message without providing some context or summary?
> 
> Yes, but the summary of the discussion would be identical to the new
> text added by the patch to the documentation tree in this case, so I
> didn't find a good introductory text before "See $URL".  Perhaps
> 
> This comes up from time to time.  See $URL for the original
> discussion.
> 
> but I do not know if that is much better.

I meant something even less in-depth. Your message says only "on
comparison", and I did not even know what "this" in your sentence above
would mean until I followed the link.

  There are arguments for writing a conditional as "a < b" rather than
  "b > a", or vice versa. Let's give guidance on which we prefer.

Not a big deal, but I think it is easy when you have just written the
patch to forget that a reviewer or a reader of "git log" six months have
no has no context at all.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 7/8] CodingGuidelines: on comparison

2014-05-02 Thread Junio C Hamano
Jeff King  writes:

> On Wed, Apr 30, 2014 at 02:45:11PM -0700, Junio C Hamano wrote:
>
>> See http://thread.gmane.org/gmane.comp.version-control.git/3903/focus=4126
>> 
>> Signed-off-by: Junio C Hamano 
>
> Don't you often complain about submitters referencing a discussion
> in a commit message without providing some context or summary?

Yes, but the summary of the discussion would be identical to the new
text added by the patch to the documentation tree in this case, so I
didn't find a good introductory text before "See $URL".  Perhaps

This comes up from time to time.  See $URL for the original
discussion.

but I do not know if that is much better.

>> + - There are two schools of thought when it comes to comparison,
>> +   especially inside a loop. Some people prefer to have less stable
>> +   value on the left hand side and more stable value on the right hand
>> +   side, e.g. if you have a loop that counts variable i down to the
>> +   lower bound,
>
> Grammar: /(less|more) stable/the &/
>
>> +   Both are valid, and we use both, even though we tend to see the
>> +   former the more preferable, the more "stable" the more stable side
>> +   becomes (comparison with a constant, "i > 0", is an extreme
>> +   example).  Just do not mix styles in the same part of the code.
>> +
>
> I had trouble parsing the first sentence. Maybe:
>
>   Both are valid, and we use both. However, the more "stable" the stable
>   side becomes, the more we tend to prefer the former (comparison with a
>   constant[...]

Thanks.  That is much better.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 7/8] CodingGuidelines: on comparison

2014-05-01 Thread Jeff King
On Wed, Apr 30, 2014 at 02:45:11PM -0700, Junio C Hamano wrote:

> See http://thread.gmane.org/gmane.comp.version-control.git/3903/focus=4126
> 
> Signed-off-by: Junio C Hamano 

Don't you often complain about submitters referencing a discussion
in a commit message without providing some context or summary?

> + - There are two schools of thought when it comes to comparison,
> +   especially inside a loop. Some people prefer to have less stable
> +   value on the left hand side and more stable value on the right hand
> +   side, e.g. if you have a loop that counts variable i down to the
> +   lower bound,

Grammar: /(less|more) stable/the &/

> +   Both are valid, and we use both, even though we tend to see the
> +   former the more preferable, the more "stable" the more stable side
> +   becomes (comparison with a constant, "i > 0", is an extreme
> +   example).  Just do not mix styles in the same part of the code.
> +

I had trouble parsing the first sentence. Maybe:

  Both are valid, and we use both. However, the more "stable" the stable
  side becomes, the more we tend to prefer the former (comparison with a
  constant[...]

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html