The practice, in naming variables, subroutines and files in computer programming, is to combine words TogetherLikeThis. Capitalization divides words from each other.
Examples:
- keyboardInterrupt
- KeyboardHandler
- MailHeader
- mailHeader
The alternatives to
BumpyCase
- connect words with underscores, together_like_this
- or connect words with dashes, together-like-this
BumpyCase seems more amenable to using variations in capitalization to indicate distinctions than the underscore convention
- For example, MailHeader is clearly a class while mailHeader is clearly an instance
- clearly? I've seen capped ivars and downcased classes. Like anything, it depends on context.
- Whereas file names and procedure names might utilize the dash-separated or underscore_separated type
When you go with
BumpyCase, you have to decide whether to capitalize all the letters in an acronym or just the first one:
- PVCPipeLength
- or PvcPipeLength
There is a problem with some languages and compilers in using the dash in naming is because the dash, or minus-sign, is used as an operator.
Underscore convention can be better with non-case-sensitive elements. If you have a PHP function doThis() there's nothing stopping you (or someone else) calling it as dothis(). do_this() enforces consistent separation.
BumpyCase is also known as CamelCase. (The CamelCase page focuses on naming conventions for wiki pages while this page focuses on CodingStandards in programming.)