Skip to content

Instantly share code, notes, and snippets.

@robatwilliams
Last active June 23, 2020 09:12
Show Gist options
  • Save robatwilliams/ecc435e5afdcb25fc4645b36fe7e7796 to your computer and use it in GitHub Desktop.
Save robatwilliams/ecc435e5afdcb25fc4645b36fe7e7796 to your computer and use it in GitHub Desktop.
Compound words and programming case styles

Compound words and programming case styles

A compound word is formed by joining together two or more other words.

A closed-form compound word (e.g. keyboard) does that without any additional punctuation. These are truly words in their own right, and so should be treated as such when applying programming casing conventions such as camelCase, PascalCase, kebab-case, or snake_case.

Open-form (e.g. living room) and hyphenated-form (e.g. long-term) compound words are less susceptible to incorrect casing.

Examples of incorrect camelCase

  • callBack
  • countDown
  • crossHair
  • dataBase
  • endPoint
  • fileName
  • lookUp
  • offLine
  • onLine
  • overRide
  • passWord
  • payLoad
  • placeHolder
  • preView
  • setUp
  • standAlone
  • timeOut
  • toolBar
  • toolTip
  • unSubscribe
  • userName
  • viewPort
  • weekDay
  • weekEnd
@robatwilliams
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment