CamelCase: Difference between revisions

From Helpful
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 1: Line 1:


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


[https://en.wikipedia.org/wiki/Snake_case]


'''snake_case''', also known as using underscores, typically just with lowercase naming
: [https://en.wikipedia.org/wiki/Snake_case]




 
'''CamelCase''' is using capitals
 
: though there is a useful distinction between lowerCamelCase and UpperCamelCase (then a.k.a. PascalCase),
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),
 
 
<!--{{comment|(There are some wikis that consider any CamelCase word to be links, without any markup required)}}-->
<!--{{comment|(There are some wikis that consider any CamelCase word to be links, without any markup required)}}-->



Latest revision as of 15:39, 8 April 2024


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

[1]


CamelCase is using capitals

though there is a useful distinction 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