Re: Mixed case?



s0suk3@xxxxxxxxx wrote:
I'm totally new to C, so this is a question from a total newbie. I
know most people write the names in C with underscores,
as_in_this_name. But... is it also customary to write them in mixed
case, asWithThisName? Or is it a horrible horrible horrible thing to
do??

"Do what comes naturally." If you like under_scores, use
under_scores. If you like camelCase, use camelCase. If you
like thingsruntogether, runthingstogether. I'd encourage you,
as a beginner, to give all three styles (and others you may
find or invent) a try for a while, and see how it feels.

A few rules, though:

- If you're making changes to an existing program, use
that program's prevailing style. You may hate it, but
if you depart from it the other programmers will hate
you still more.

- Stick with one style throughout one program or library;
don't mix-and-match.

- Steer clear of "reserved identifiers." The C language
assigns meaning to some identifiers like printf, and
reserves the right to do so in the future with currently
unused identifiers like straphanger and isosceles. See
http://www.oakroadsystems.com/tech/c-predef.htm for a
list of some of these; it's out of date but will give
a useful heads-up.

- Most Of All: Do NOT!!! perpetuate that so-called
"Hungarian notation" abomination, a reasonable idea
that was twisted into a psychotic nightmare by weak-
brained enthusiasts.

--
Eric.Sosman@xxxxxxx
.



Relevant Pages

  • Re: strdup
    ... Each header declares or defines all identifiers listed ... Is the str_dupfunction or the strdup macro that you're saying is ... reserved identifiers in all circumstances than to keep track of all ...
    (comp.lang.c)
  • [OT] Re: C is too old? opinions?
    ... And no need for a trailing underscore at all. ... identifiers ..." ... I have it on reliable authority (the entrails of a goat) ...
    (comp.lang.c)
  • Re: Why Case Sensitive?
    ... more advantages in ignoring letter case in source code. ... I have seen Pascal (which has case insensitive identifiers) ... CamelCase, camelCase, camelcase, Camelcase, cameLcase, ... ... with a case-insensitive language, it was necessary to do something like: ...
    (comp.lang.c)
  • Re: strdup
    ... Reserved identifiers ... Each header declares or defines all identifiers listed ... Is the str_dupfunction or the strdup macro that you're saying is ...
    (comp.lang.c)
  • Re: strdup
    ... C99 7.26.11, under "Future library directions": ... Reserved identifiers ... Each header declares or defines all identifiers listed ... extern void strlws; ...
    (comp.lang.c)