Examples

Here are some examples for well named variables:

  • firstName
  • age
  • startIndex
  • lastNegativeNumberIndex

Here are some examples for badly named variables, even though the names are correct according to the C# compilator:

  • _firstName (starts with '_')
  • last_name (contains '_')
  • AGE (it is written in uppercase)
  • Start_Index (starts with an uppercase letter and contains '_')
  • lastNegativeNumber_Index (contains '_')

At a first look all these rules can seem meaningless and unnecessary, but with time passed and gaining experience you will see the need for norms for writing quality code in order to be able to work easier and faster in a team. You will understand that the work with a code, which is written without complying with any rules for quality code, is extremely annoying.

results matching ""

    No results matching ""