[net.micro.mac] Naming conventions in C

sjl@amdahl.UUCP (Steve Langdon) (07/18/85)

The source that Steve Hawley ({joevax,mouton,alice}!sdh) recently posted
in net.sources.mac brings to light once again an unpleasant problem.
To quote a message I posted on the subject some months ago:

>The community of Mac programmers using C are faced with an unpleasant
>compatibility problem.  Megamax C naming conventions do not follow
>Apple's recommendations and it is very painful to convert programs
>written for the Megamax compiler to run with compilers that do adhere to
>Apple's standard.
>...
>It is extremely tedious to translate a large number of identifiers even
>when you have the UNIX text processing tools available.  A Mac user
>without UNIX access would have a really bad time performing the conversion.
>I, along with many UNIX users dislike reaching for the shift key, but I
>consider Megamax's decision to use lower case names a piece of crass
>stupidity.  An imperfect standard is better than no standard in this
>situation, and I hate to think about the hours that will be wasted if
>Megamax do not conform.
>...
>For those unfamiliar with Apple's naming convention I have included the
>pertinent section of the SUMacC document.
>
>>Naming conventions.
>>
>>     Since Pascal is case insensitive,  some  of  the  names
>>present in the original Pascal header files had inconsistent
>>case conventions.  Apple realized the headaches  this  could
>>cause  for C programmers, and in October 84 released a small
>>set of rules that govern case in names.  When you invent new
>>names, you should use these rules.
>>
>>1.  The first character of a name is upper case if the  sym-
>>    bol  is:   a  toolbox routine name, a type, an assembler
>>    global symbol.
>>    e.g.: InitGraf, MoveTo, ProcPtr, MonkeyLives
>>
>>2.  The first character of a name is lower case if the  sym-
>>    bol is:  a field, a constant, a variable.
>>    e.g.: shiftKey, everyEvent, fInvisible
>>
>>3.  If the name consists of multiple words, the subwords are
>>    capitalized.
>>
>>4.  If there are acronyms within the name,  they  are  cased
>>    the same.
>>    e.g.: fCTS, ctsHold, TEHandle, TENew, eofErr
>>

I believe that Megamax provides a program which will translate their
names to the standard form.  Please use it before posting your source.
-- 
Stephen J. Langdon                  ...!{ihnp4,hplabs,sun,nsc}!amdahl!sjl

[ The article above is not an official statement from any organization
  in the known universe. ]