Sunday 20 November 2011

What is camel notation? in C programming

What is camel notation?

Camel notation, as it has come to be known, involves using mixed upper- and lowercase letters to form variable and function names. For instance, here is the same function named using the camel notation method
and the underscore method:

PrintEmployeePaychecks();

print_employee_paychecks();

The first version of this function uses the camel notation—each logical break in the function name is accentuated by the use of a capital letter. The second version of the function uses the underscore method— each logical break in the function name is accentuated by the use of an underscore.

Camel notation has gained in popularity over the years, and it is used quite a bit in many newer libraries and environments such as Microsoft Windows. The underscore method, on the other hand, has been around since C’s first years and is very popular in older programs and environments such as UNIX.

Cross Reference:

XIX.1: Should the underscore be used in variable names?
XIX.2: Can a variable’s name be used to indicate its data type?
XIX.6: Do longer variable names affect the speed, executable size, or efficiency of a program?
XIX.9: How many letters long should variable names be? What is the ANSI standard for significance?
XIX.10: What is Hungarian notation, and should I use it?

No comments:

Post a Comment