[Part-3] Camel Case and Pascal Case

Shrutika Dorugade
2 min readMay 30, 2020

--

Hello friends, today let us see some naming conventions which often industry follows while coding.

  • As the title suggests, there are two cases which are used during coding :
  1. Camel Case
  2. Pascal Case
  • So friends, the primary reason to use this conventions is to easily read the class or method or variable names.
  • As you know often class or method or variable names are composed of multiple different words.

e.g. patienttesthistroy

  • The above name has three different words patient, test, history. But to read the name with all small letters or all capital letters is quite difficult. That’s why we use camel case or pascal case.

Camel Case :

In camel case, first letter of first word is small and after that first letter of each word is capital and rest of the letters are small.

Name : patienttestname

Camel Case : patientTestName

  • Camel case is used while writing the names of variables.
  • As you know there are two kinds of variables : public and private.
  • So to differentiate between them, private variables are given underscore at the beginning as shown below,

Public Variable : patientTestName

Private Variable : _patientTestName

Pascal Case :

In pascal case, first letter of each word is capital and all other letters are small.

Name : patienttesthistory

Pascal Case : PatientTestHistory

  • Pascal case is used while writing the names of methods and classes.

Below diagram explains all above concept,

Camel Case and Pascal Case

Note :

  1. It is not compulsory to use camel case for variables and pascal case for classes or methods.
  2. You can use camel case for classes or methods and pascal case for variables also.
  3. Just ensure that your code will follow some standards to better understand the written code.

Do let me know if you find this article helpful. Thank You!

[Part-1] Introduction to Angular

[Part-2] Directives and DOM in Angular

[Part-3] Camel case and Pascal case

[Part-4] Routing for navigation in Angular

If you want to learn more about angular in a hour please go through the below video :

--

--

Shrutika Dorugade

Working as a Application Development Associate in Accenture