From: Paul Moore <paul.moore@hp.com>
To: russell@coker.com.au
Cc: Vesa-Matti J Kari <vmkari@cc.helsinki.fi>, selinux@tycho.nsa.gov
Subject: Re: [patch] SELinux: trivial, unify iterator variable naming
Date: Wed, 30 Jul 2008 11:22:06 -0400 [thread overview]
Message-ID: <200807301122.06990.paul.moore@hp.com> (raw)
In-Reply-To: <200807301248.04810.russell@coker.com.au>
On Tuesday 29 July 2008 10:47:59 pm Russell Coker wrote:
> On Monday 21 July 2008 23:38, Paul Moore <paul.moore@hp.com> wrote:
> > A few thoughts: others did not object to those variable names when
> > the patches were proposed, or at any point prior to this thread,
> > and no one besides you and I has commented on this thread. This is
> > a sign to me that the 'idx' variable name is not a significant
> > distraction to the community.
>
> One thing that is worth considering is the possibility that idx might
> be better for searching.
>
> Lots of words contain an 'i' character and therefore searching for a
> variable named 'i' in a code base is going to be difficult (automated
> searching is mostly useless, probably the best option is to have your
> editor highlight every instance and visually scan for the ones with
> are not surrounded by brackets, braces, parenthesis, spaces, commas,
> or whatever else is not acceptable in a variable name in the language
> in question.
>
> Of course if you have a syntax highlighting editor then it might
> parse enough of the language to avoid this (but that isn't always
> available), and if you have a language such as Perl a search for \$i
> should work reasonably well.
>
> http://etbe.coker.com.au/2008/07/30/variable-names/
>
> But using idx, index, or even names such as "count" which refer to
> the meaning of the program might be more efficient overall. I've
> posted some more thoughts on this issue at the above URL.
FWIW, you hit on my own selfish reasons for using "idx" instead of "i":
easier searching (my XEmacs config highlights search terms in red) and
greater "understandability".
--
paul moore
linux @ hp
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2008-07-30 15:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-20 21:46 [patch] SELinux: trivial, unify iterator variable naming Vesa-Matti J Kari
2008-07-21 1:25 ` Paul Moore
2008-07-21 8:08 ` Vesa-Matti J Kari
2008-07-21 12:24 ` Paul Moore
2008-07-21 13:08 ` Vesa-Matti J Kari
2008-07-21 13:38 ` Paul Moore
2008-07-22 18:21 ` Vesa-Matti J Kari
2008-07-23 3:10 ` Paul Moore
2008-07-30 2:47 ` Russell Coker
2008-07-30 15:22 ` Paul Moore [this message]
2008-07-30 16:04 ` Vesa-Matti J Kari
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=200807301122.06990.paul.moore@hp.com \
--to=paul.moore@hp.com \
--cc=russell@coker.com.au \
--cc=selinux@tycho.nsa.gov \
--cc=vmkari@cc.helsinki.fi \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.