[LLVMdev] [cfe-dev] draft rule for naming types/functions/variables

Zhanyong Wan (λx.x x)
Wed, 01 Dec 2010 01:02:08 -0000

Thanks for the comments, Chris!  Glad that we are making progress.

I'll make most of the edits you suggested later today.  Before that,
there are a couple of high-level points I'd like to go over with you.

1. I totally agree that the biggest benefit of a naming convention is
uniform APIs.  On the other hand, an inconsistent local naming style
hurts the productivity of contributors and can lead to bugs by causing
confusion.  I'm fine with local variables having short names when
their scope is limited (say, fits within one screen) or their role is
obvious (like 'i' for an iterator), but I do find the context
switching annoying when I have to adjust for the different styles as I
move to different parts of the codebase.  Just something for you to
consider.

2. (more important than #1) I'd like to understand the reason behind
your preference for UpperCase names for ivars.  Is it just a personal
preference or is there a more profound reason?  So far, I've heard
that some people like lowerCase ivars (clear distinction from types,
etc), and some people don't think that helps much.  However, I'm yet
to hear why UpperCase ivars are considered *better* than lowerCase, so
I'm curious.

Thanks.

--
Zhanyong