Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the different kinds of cases?

I'm interested in the different kinds of identifier cases, and what people call them. Do you know of any additions to this list, or other alternative names?

  • myIdentifier : Camel case (e.g. in java variable names)
  • MyIdentifier : Capital camel case (e.g. in java class names)
  • my_identifier : Snake case (e.g. in python variable names)
  • my-identifier : Kebab case (e.g. in racket names)
  • myidentifier : Flat case (e.g. in java package names)
  • MY_IDENTIFIER : Upper case (e.g. in C constant names)
like image 686
Austin Cory Bart Avatar asked Jun 26 '13 17:06

Austin Cory Bart


People also ask

What are the different types of cases?

More specifically, federal courts hear criminal, civil, and bankruptcy cases. And once a case is decided, it can often be appealed.

What are the two different kinds of cases?

Civil and Criminal Cases The law deals with two kinds of cases. Civil cases involve conflicts between people or institutions such as businesses.

What are examples of cases?

Cases involving claims for such things as personal injury, battery, negligence, defamation, medical malpractice, fraud, and many others, are all examples.


2 Answers

  • flatcase
  • kebab-case. Also called caterpillar-case, dash-case, hyphen-case, lisp-case, spinal-case and css-case
  • camelCase
  • PascalCase or CapitalCamelCase
  • snake_case or c_case
  • MACRO_CASE or UPPER_CASE
  • COBOL-CASE or TRAIN-CASE
like image 146
Shadi Namrouti Avatar answered Sep 30 '22 17:09

Shadi Namrouti


Names are either generic, after a language, or colorful; most don’t have a standard name outside of a specific community.

There are many names for these naming conventions (names for names!); see Naming convention: Multiple-word identifiers, particularly for CamelCase (UpperCamelCase, lowerCamelCase). However, many don’t have a standard name. Consider the Python style guide PEP 0008 – it calls them by generic names like “lower_case_with_underscores”.

One convention is to name after a well-known use. This results in:

  • PascalCase
  • MACRO_CASE (C preprocessor macros)

…and suggests these names, which are not widely used:

  • c_case (used in K&R and in the standard library, like size_t)
  • lisp-case, css-case
  • COBOL-CASE

Alternatively, there are illustrative names, of which the best established is CamelCase. snake_case is more recent (2004), but is now well-established. kebab-case is yet more recent and still not established, and may have originated on Stack Overflow! (What's the name for dash-separated case?) There are many more colorful suggestions, like caterpillar-case, Train-case (initial capital), caravan-case, etc.

like image 26
Nils von Barth Avatar answered Sep 30 '22 16:09

Nils von Barth