Results 1 to 3 of 3

Thread: Not serious question

  1. #1
    Ivan is offline Registered User
    Join Date
    Feb 2003
    Location
    Helsinki, Finland
    Posts
    15

    Not serious question

    Not very serious question to ZeroC staff.

    Why did you change naming convention for member variables?

    In Orbacus you used underscore as a postfix for member variables, like "mutex_" and now in Ice you use it as a prefix "_mutex".

    Just wondering, any reason?

    Personally, I prefer first way.

    Ivan

  2. #2
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    We took a vote

    What's interesting with coding convention is that you prefer what you are used to. I prefered the foo_ style, too. But now I prefer the _foo style, and don't understand how we could ever use the ugly foo_ style

  3. #3
    marlowa is offline Registered User
    Join Date
    Feb 2003
    Location
    London
    Posts
    64
    Originally posted by marc
    We took a vote :D

    What's interesting with coding convention is that you prefer what you are used to. I prefered the foo_ style, too. But now I prefer the _foo style, and don't understand how we could ever use the ugly foo_ style :cool:
    People prefer what they are used to. And they can get used to anything. However I think that historically a trailing underscore has been preferred because of section 17.4.3.1.2 of the std which says "each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace". I realise that this only applies to global names and therefore does not apply to the names of private data members but in the past I used to quote this section of the std as a way of saying 'beware of using a leading underscore in identifiers'.

    I think this explains why people are not used to it and why it makes some (including me) uneasy. Some corporate coding stds prohibit it because of the influence of section 17.4.3.1.2.


    -apm
    You are in a maze of twisty little passages, all different.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •