All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Julien Grall <julien.grall@arm.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	nd@arm.com
Subject: Re: [PATCH] CODING_STYLE: discourage use of underscores where alternatives exist
Date: Mon, 11 Jun 2018 12:26:16 +0100	[thread overview]
Message-ID: <CAFLBxZZu6SHwndECrTGoh9kskkFmDMXO42vTKD+F9tggtw4TZA@mail.gmail.com> (raw)
In-Reply-To: <5B1A21E302000078001C950B@prv1-mh.provo.novell.com>

On Fri, Jun 8, 2018 at 7:27 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 07.06.18 at 23:21, <julien.grall@arm.com> wrote:
>> On 07/06/2018 14:56, Jan Beulich wrote:
>>> Underscores commonly require two keypresses while hyphen / dash requires
>>> just one, and the visual separation effect of both is basically the same.
>>
>> I don't buy this argument. A good programmer is lazy by definition but
>> not that much. C does not allow identifiers with hyphen, so you end up
>> to use underscore most of time as you don't often create new filename
>> and most of the editors have filename auto-completion.
>
> Filenames are just one aspect. I don't think there's any auto completion
> for command line options. I'm also not convinced that auto completion is
> a meaningful argument here in the first place: In many cases, it wouldn't
> help anyway (take x86's guest_*.h or mach_*.h as examples), no
> matter whether underscores or hyphens are used.
>
> Further, the laziness aspect is only one here anyway. To me, the use
> of underscores where better alternatives exist is an abuse; it often
> seems to me as if people doing so simply don't care to get out of their
> programming language determined mindset.

This is actually why my currently preferred bike shed color is "use
underscores for files containing code".  Taking the time to figure out
when you can or can't use underscores takes mental effort, but the
only value it gives you is occasionally being able to avoid a combined
key press.  (Pressing shift and a key together is more effort and
coordination than simply pressing two keys in sequence.)  Simply using
underscores all the time makes things simpler, so coders can focus on
other things.

I'm fine with using dashes instead of underscores for command-line
parameters, because those are usually typed in a non-coding context.
But creating, opening, or including files containing code is done
primarily in a coding context, and so staying "in a programming
language determined mindset" is a feature rather than a bug.

I don't have super strong opinions either way.

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-06-11 11:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07 13:56 [PATCH] CODING_STYLE: discourage use of underscores where alternatives exist Jan Beulich
2018-06-07 21:21 ` Julien Grall
2018-06-08  6:27   ` Jan Beulich
2018-06-11 11:26     ` George Dunlap [this message]
2018-06-11 11:26     ` George Dunlap

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=CAFLBxZZu6SHwndECrTGoh9kskkFmDMXO42vTKD+F9tggtw4TZA@mail.gmail.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=nd@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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.