Re: Caps convention.

From: E. Robert Tisdale (E.Robert.Tisdale_at_jpl.nasa.gov)
Date: 12/20/03


Date: Sat, 20 Dec 2003 11:08:00 -0800

Thomas Matthews wrote:
> Malcolm wrote:
>
>> Use all lower case for ansi c functions
>> and Capitalize For Platform-Specific.
>>
>> If you call something with caps,
>> then your function name requires caps itself.

No!
That would imply that your API *depends* upon
details of its implementation.

> The common style is to use all-caps for constants and macros.

This is an anachronism.

> Function name styles differ:
> leading word starts lowercase followed by Capitalized words:
> thisIsMyFunction
> same thing, using underscores:
> this_Was_My_Function
> starting with Captials:
> ThisIsAnotherFunction
> This_May_Be_More_Readable
> as you suggested:
> anansicfunction
> another_ansi_function

These aren't really styles. The are typing shortcuts
for programmers with a missing shift key.
The idea was that because capital letters and underscore
required the programmer to hold down the shift key,
they slowed down typing (meaning productivity).
The first style above is a compromise
between readability and typing efficiency.

> However, most all good coding styles
> don't permit function names to start with '_' (underscores)
> as these are reserved for implementations.

Again, this rule has nothing to do with style.
It's just a way to avoid conflicts with the implementation.

> This is a religious issue: all a matter of faith.
> As long as you are consistent and the names are readable,
> any style will do.
> Just as there is no best religion, there is no best coding style.

Yes, but no "true believer" will agree with you.



Relevant Pages

  • Re: Shift key will not type upper case
    ... He is using the shift key to type numerous capital letters in a row. ... After typing 6 or 8 caps, if he pauses in the text string, the system starts typing lower case again. ... You might try experimenting with the Accessibility options. ...
    (microsoft.public.win2000.general)
  • Re: PROSTATE PROBLEM
    ... Do you know the difference in the "Shift key" and the "Caps ... Duh again, for me ... Name calling has no place on the newsgroup. ...
    (sci.med.prostate.bph)
  • Re: PROSTATE PROBLEM
    ... Do you know the difference in the "Shift key" and the "Caps ... Name calling has no place on the newsgroup. ... Thanks Pete, ...
    (sci.med.prostate.bph)
  • Re: PROSTATE PROBLEM
    ... Do you know the difference in the "Shift key" and the "Caps lock ... Duh again, for me having to explain that to you. ... the newsgroup dosen't need the vulgarity. ...
    (sci.med.prostate.bph)
  • Re: PROSTATE PROBLEM
    ... Do you know the difference in the "Shift key" and the "Caps lock ... Duh again, for me having to explain that to you. ...
    (sci.med.prostate.bph)