[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] CODING_STYLE: discourage use of underscores where alternatives exist



On Fri, Jun 8, 2018 at 7:27 AM, Jan Beulich <JBeulich@xxxxxxxx> wrote:
>>>> On 07.06.18 at 23:21, <julien.grall@xxxxxxx> 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@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.