CamelCase: Difference between revisions

From Helpful
Jump to navigation Jump to search
(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....")
 
mNo edit summary
Line 12: Line 12:
...but there is a useful distincition between lowerCamelCase and UpperCamelCase (then a.k.a. PascalCase),
...but there is a useful distincition between lowerCamelCase and UpperCamelCase (then a.k.a. PascalCase),


{{comment|(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.)}}


<!--{{comment|(There are some wikis that consider any CamelCase word to be links, without any markup required)}}-->




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


This is used e.g. in programming languages - where there are sometimes added names for these choices.


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





Revision as of 12:26, 2 August 2023

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),



This is used e.g. in programming languages - where there are sometimes added names for these choices.

whether to use underscores or camelcase, and what for, 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