Naming conventions in software development

 In software development, the importance of naming cannot be underestimated. As developers, we name variables, methods, classes almost every day. However, have you ever thought about the significance of naming? In this article, I will explain five common naming conventions used in the software development.

Why is naming important?

Effective naming is more than just a formality. When we choose appropriate names for our elements, we make our code more clear, readable, and easy to understand. Well-named code makes the project easier to maintain, modify and collaborate.

What is the naming convention types

There are many kinds of naming conventions but I am going to explain 5 of them below in this article.

  •  Camel Case
  •  Snake Case
  •  Kebab Case
  •  Pascal Case
  •  Hungarian Notation

Camel Case

·        Names start with a lowercase letter.

·        Subsequent words start with an uppercase letter.

·        Examples: userName, identityNumber

Snake Case

·        Words are all in lowercase.

·        Words are separated by underscores (_).

·        Examples; user_name, identity_number

Kebab Case

·        Words are all in lowercase.

·        Words are separated by hyphen (-).

·        Examples; user-name, identity-number

Pascal Case

·        Words start with an uppercase.

·        Examples; UserName, IdentityNumber

Hungarian Notation

·        Includes a prefix representing variable’s type.

·        Words start with an uppercase letter except for the prefix.

·        Examples; strUsername, iAge.

Yorumlar