Code Crash Course

camelCase and snake_case

camelCase and snake_case

After coding for a few weeks now, you have probably noticed that code employs some different capitalization schemes than traditional English. Each language has preferences for how to write variables, classes, etc. Typically things are written in camelCase, snake_case, or (sometimes) PascalCase.

  • camelCase: Each word is marked by a single uppercase letter, except for the first letter (which is always lowercase)
  • PascalCase: Very similar to camelCase but the first letter is also capitalized
  • snake_case: Each word is separated by an underscore, no letters are capitalized

In python, variables are written in snake_case, and classes are written in PascalCase. In javascript, typically everything is written in camelCase.