From: Vijay Lakshminarayanan <laksvij@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jeff King <peff@peff.net>, Stephen Bash <bash@genarts.com>,
git discussion list <git@vger.kernel.org>
Subject: Re: Git blame only current branch
Date: Tue, 13 Dec 2011 19:39:56 +0530 [thread overview]
Message-ID: <87y5ugsguj.fsf@gmail.com> (raw)
In-Reply-To: <7vobvdvx9c.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Mon, 12 Dec 2011 21:47:11 -0800")
Junio C Hamano <gitster@pobox.com> writes:
> Vijay Lakshminarayanan <laksvij@gmail.com> writes:
>
>> The code reads fine when there's no numeral 1 around but now it doesn't
>> read well. I think refactoring
>>
>> struct commit_list *l
>>
>> to
>>
>> struct commit_list *lst
>>
>> is justified. Thoughts?
>
> Not justified at all.
>
> What is "lst" and why is it not spelled "list"? It is a disease to drop
> vowels when you do not have to.
lst is better than l in this particular context. I think fried_chicken
is better than l in this particular context ;-)
> If I were to name a new variable that points at one element of a linked
> list and is used to walk the list (surprise!) "element" or perhaps "elem"
> for short, but in the context of that short function I honestly do not see
> much need for such a naming. The variable is extremely short-lived and
> there is no room for confusion.
Before the introduction of the numeral 1, I am in complete agreement
with you for the exact reasons you've mentioned above. Post
introduction of "l ? 1 : 0" it warrants a refactoring. It's possible
you're using a different font so you never encounter the issue, but this
definitely isn't a problem I alone face. For instance, it is a
sufficiently common problem that it's one of the "Java Puzzlers" in Josh
Bloch's book of the same name. (Yes, elem is better than lst.)
My $0.02.
--
Cheers
~vijay
Gnus should be more complicated.
next prev parent reply other threads:[~2011-12-13 14:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <e9e35956-a091-4143-8fd4-3516b54263a6@mail>
2011-12-12 15:24 ` Git blame only current branch Stephen Bash
2011-12-12 16:55 ` Jeff King
2011-12-12 17:05 ` Stephen Bash
2011-12-12 17:19 ` andreas.t.auer_gtml_37453
2011-12-13 2:07 ` Vijay Lakshminarayanan
2011-12-13 2:14 ` Jeff King
2011-12-13 5:47 ` Junio C Hamano
2011-12-13 14:09 ` Vijay Lakshminarayanan [this message]
2011-12-13 14:18 ` Frans Klaver
2011-12-13 17:25 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y5ugsguj.fsf@gmail.com \
--to=laksvij@gmail.com \
--cc=bash@genarts.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).