Using all CPAITAL letters for variable names

Discussion in 'C Programming' started by arnuld, Aug 27, 2008.

  1. arnuld

    arnuld Guest

    I use capital letters for macros only. Is it a good idea
    to use all capitals for things like constant variables and variables and
    array in global namespace ?



    --
    www.lispmachine.wordpress.com
    my email is @ the above blog.Google
    Groups is Blocked. Reason: Excessive Spamming
    arnuld, Aug 27, 2008
    #1
    1. Advertising

  2. On 27 Aug, 07:38, arnuld <> wrote:

    > I use capital letters for macros only.


    that was the original, and still widely used, convention
    it is to draw attention to the fact that "something funny"
    may happen because the preprocessor is involved.

    *Some* people also capitalise enum values. I suppose
    because the are "like" macro constants.

    > Is it a good idea
    > to use all capitals for things like constant variables and  variables and
    > array in global namespace ?


    IMHO, no

    but then you shouldn't have many variables in the global namespace...


    --
    Nick Keighley

    Many astrologers think that this concentration on [the sun-sign
    column] has
    done untold damage to serious astrology.
    The Independent
    Nick Keighley, Aug 27, 2008
    #2
    1. Advertising

  3. arnuld

    Guest

    On Aug 27, 9:38 am, arnuld <> wrote:
    > I use capital letters for macros only. Is it a good idea
    > to use all capitals for things like constant variables and variables and
    > array in global namespace ?


    If it's *your* C project, you write the specification, and you can
    make it a good idea.
    If it's someone elses project, you read his/her specification, and you
    figure out whether they like it or not.
    C doesn't say anything about it (thus such question might be off-
    topic)
    Though there's things to look out for when choosing names: E?*
    (where ? is a digit or capital) are reserved identifiers.
    , Aug 27, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wanwan
    Replies:
    3
    Views:
    415
    Alex Martelli
    Oct 14, 2005
  2. Merrigan
    Replies:
    4
    Views:
    557
    Chris
    Dec 14, 2007
  3. News123
    Replies:
    2
    Views:
    454
    John Machin
    Nov 26, 2008
  4. Peter Buckley
    Replies:
    5
    Views:
    194
    matt neuburg
    Feb 27, 2009
  5. Venugopal
    Replies:
    11
    Views:
    1,495
    Tassilo v. Parseval
    Nov 5, 2003
Loading...

Share This Page