Click here to Skip to main content
13,252,537 members (55,117 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


10 bookmarked
Posted 26 Jul 2013

Naming Conventions

, 27 Jul 2013
Rate this:
Please Sign up or sign in to vote.
Naming conventions


This is one of the series of articles “Coding guidelines and Best practices”, and today we will cover Naming conventions.


What is Naming Convention?

Naming convention is something which answers a question “How to name an element.”
In programming, it can be defined as set of rules which tells how an identifier will be named, like:

  • What all characters are permissible?
  • How it should be formatted or organized?
    And so on...

When it comes to naming, it’s quite a contentious topic.

Why Naming Convention is Required?

Try to read the following word:

  • gradeofamericancustomer

It’s challenging to read it in a single glance.

Now try to read this one:

  • GradeOfAmericanCustomer

The answer is:

  • Respectable programming is that where code is healthy written, which can be easily read and apprehended.
    And for readability, naming convention is a must. No one can read my name if I write like “sukeshmarla”, but can if it’s like “Sukesh Marla”.
  • When we talk about a project, we have a team. And it will be very difficult when every programmer in a team uses his own way or standard for defining variables. Difficulties in both management and understanding. It becomes even more difficult when a team member resigns and new guys take over.
    So why every company defines centralized Naming Conventions and brings consistency.
  • Readability and consistency need reduced effort to read and understand the code (especially written by other developers).
  • A proper naming convention with modern enhanced Intellisense feature drastically improves the development speed.

What are the Different Types of Naming Conventions?

The first golden rule everyone should follow is “Variable name should be meaningful.”

There are lots of common conventions out there for naming Identifiers. Some of them are:

  • Pascal (aka Upper Camel) - First letter of every single word will be capital. Example: GradeOfCustomer
  • Camel - Begins with lower case and then capitalizes first letter of every following word. Example: gradeOfCustomer
  • Hungarian - Variables are prefixed with some kind of information like Data Types, Modifiers, etc. Example: strCustomerName, intCustomerAge

How to Decide Conventions?

We already spoke about importance about naming conventions. Choosing convention completely depends on how we think, it’s actually a though process thing. Let me share my thoughts about the same.

  • Nowadays, all IDEs (like Visual Studio) provide a great Intellisense, so using Hungarian notation will not be a good idea. It just makes variable more complicated to read.
  • Pascal or Camel - we must choose at least one of them. But which one? Well, it’s up to which you are comfortable in. For instance in Java, Camel case is used extensively whereas in .NET, Microsoft preferred Pascal (upper camel case).
    I am a .NET developer, so I prefer Pascal casing for class members and Camel for local members (members defined inside a function or function parameters).
  • Other than Pascal and Camel, some people often use one more notation where name starts with underscore followed by camel casing. For example _age, _dateOfBirth.
    Normally, this notation is used for naming private data members.
    I personally feel great about this.
    It comes in handy when we have a class with say hundreds of data members (combination of private and others). And when it comes to accessing any private member inside member function, developer just presses ‘_’ and Intellisense will show all private members at the top.



This post cannot be treated as a final documented Naming convention document. Here, I tried to explain the importance of naming convention and how to choose them.
As I said, choosing a naming convention is completely a thought process. We should remember them by their significance, not just by mugging documents. Pascal, Camel, Hungarian each of them has their own significance, when it comes to readability of code.

Hope all of you enjoyed reading this post.

Keep updated on articles - Facebook, twitter@SukeshMarla.

For technical training related to various topics including ASP.NET, Design Patterns, WCF and MVC contact SukeshMarla[at] or at

For more stuff like this click here. Subscribe to article updates or follow at twitter @SukeshMarla

<iframe width="560" height="315" src="" frameborder="0"> </iframe>


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Marla Sukesh
Instructor / Trainer Train IT
India India
Learning is fun but teaching is awesome.

Code re-usability is my passion ,Teaching and learning is my hobby, Becoming an successful entrepreneur is my goal.

By profession I am a Corporate Trainer.
I do trainings on WCF, MVC, Business Intelligence, Design Patterns, HTML 5, jQuery, JSON and many more Microsoft and non-Micrsoft technologiees.

Find my profile here

My sites


You may also be interested in...

Comments and Discussions

SuggestionLeft out a few Pin
Chad3F1-Aug-13 20:51
memberChad3F1-Aug-13 20:51 
GeneralRe: My vote of 5 Pin
Marla Sukesh29-Jul-13 10:03
professionalMarla Sukesh29-Jul-13 10:03 
GeneralMy vote of 4 Pin
Amir Mohammad Nasrollahi27-Jul-13 21:27
professionalAmir Mohammad Nasrollahi27-Jul-13 21:27 
GeneralRe: My vote of 4 Pin
Marla Sukesh27-Jul-13 21:44
professionalMarla Sukesh27-Jul-13 21:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171114.1 | Last Updated 27 Jul 2013
Article Copyright 2013 by Marla Sukesh
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid