CamelCase

From Helpful
Revision as of 13:29, 21 December 2020 by Helpful (talk | contribs) (Created page with " There is '''snake_case''', also known as using underscores, typically just with lowercase naming [https://en.wikipedia.org/wiki/Snake_case] There's also using capitals....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

There is snake_case, also known as using underscores, typically just with lowercase naming

[1]



There's also using capitals. I've always known this as CamelCase

...but there is a useful distincition between lowerCamelCase and UpperCamelCase (then a.k.a. PascalCase),

(A few wikis that like to make things links without markup, which then have a more explicit WikiCase, which is UpperCamelCase that can't be one letter long.)


There's also a few languages that allow this-kind-of-naming which has even more names.



underscores versus camelcase is one of those arguments withing the programming world, mostly arguing about which is easier to type and/or read.


In the languages I work in, people seem to agree that

CONSTANTS
ClassNames
variable_names

but they disagree between

functionNames
function_names


Other naming conventions

The point of the distinctions are often to make it easier to guess the purpose or type of a thing based on just the name, rather than having to check.

In that area there are further conventions, like

  • using _ for variables you'll ignore
  • using
is_something or has_something for a human-readable suggestion that something returns a boolean
do_something to suggest it's something and probably with side effects



https://en.wikipedia.org/wiki/Naming_convention_(programming)#Multiple-word_identifiers