Tuesday, March 5, 2019

Best Practices for Naming a Variable

Hi all here i am show you how to naming a variable


  1. Choose a variable name that make sense. For example, nameagesubject makes more sense than na and s.
  2. Use camelCase notation (starts with lowercase letter) for naming local variables. For example, numberOfStudentsage, etc.
  3. Use PascalCase or CamelCase (starts with uppercase letter) for naming public member variables. For example, FirstNamePrice, etc.
  4. Use a leading underscore (_) followed by camelCase notation for naming private member variables. For example, _bankBalance_emailAddress, etc.
Thank you,
Arjun walmiki

No comments:

Post a Comment