Skip to main content

Letter Case

Muhammad FurqanAbout 1 min

Introduction

Letter cases, also known as case sensitivity, refer to the distinction between uppercase and lowercase letters in the context of programming. Many programming languages are case-sensitive, meaning that the language treats uppercase and lowercase letters as distinct characters. This can have important implications for coding, as the use of the wrong case can result in errors or unexpected behavior in your program.

It is a good practice to use a consistent letter case style throughout your code. There are several common conventions for letter case in coding, including snake case, camel case, Pascal case, kebab case, and screaming snake case.

Tips

It is important to choose a letter case style and be consistent with it in your code. This will make your code easier to read and understand for yourself and others.

Types of Letter Case

Here are the common letter cases:

Upper Case

The capital form of a letter, for example, "A" or "B".

Lower Case

The small form of a letter, for example, "a" or "b".

Title Case

The capitalization of the first letter of each word, for example, "The Quick Brown Fox".

Sentence Case

The capitalization of the first letter of a sentence, for example, "The quick brown fox."

Snake Case

A naming convention in which names are written in lowercase letters and words are separated by underscores, for example, "hello_world".

Camel Case

A naming convention in which names are written in lowercase letters and words are separated by capitalizing the first letter of each word except for the first word, for example, "helloWorld".

Pascal Case

A naming convention similar to camel case, but the first letter of every word is capitalized, for example, "HelloWorld".

Kebab Case

A naming convention in which names are written in lowercase letters and words are separated by hyphens, for example, "hello-world".

Screaming Snake Case

A naming convention similar to snake case, but all letters are written in uppercase, for example, "HELLO_WORLD".