Not serious question

IvanIvan Member
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

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    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:
  • marlowamarlowa Member Andrew MarlowOrganization: Wellabove LtdProject: study into feasibility of ice on WINCE project ✭✭
    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
Sign In or Register to comment.