How to Create an Identifier
One thing that is nice about Microsoft is that it is going to provide you with a variety of suggestions that you can use to get C# to work well.
And one of these recommendations is that programmers of C# should work with the Camel notation with their work and with the variables that they write out.
And then, when you work with the methods we have talked about, you will need to work with the method that is a bit different, one known as the Pascal notation.
To a beginner, this may not make sense, so let’s dive into them.
When we talk about the Camel notation, you will need to make sure that the first letter in the variable name is a lower case.
If your new identifier or variable is going to be a compound word, then you will need the first letter in the second word to be an uppercase letter.
This helps to keep them separate and tends to make reading them a bit easier.
A good example of some of the codes that we can write out in camel case would be the following:
payment
complete payment
mathematics
firstClass
The Pascal notation will take things a bit differently.
This notation style is going to ask you to start the first word using an uppercase letter.
The first letter in all of the other words in the sequence should also be done in uppercase as well. Some examples of using the Pascal notation include:
WriteLine()
ReadLine()
Start()
Main()
While you are naming these identifiers, you will be able to work with numbers and underscores as well.
But, if you will not be able to start these identifiers with a number.
You can write out something like sevenbooks, but you could not write out 7books.
We need to remember when we work on this that the notations are not something that is required all of the time, and you are able to make some changes to use them to help us give the identifiers a name if you would like.
But the Pascal and Came notations are going to be seen as the proper way to do it in coding, so it is best to use it so that other programmers know what you are talking about along the way.
As we can see, already working with the C# language is not that hard to work with, even as a beginner.
There are going to be quite a few parts that come together, and we need to remember as we go through, and sometimes it is going to seem like a lot to try and keep track of with all of the rules.
But as we go through our coding, we will see why these parts are in place, and why they are so important to some of the work that we want to do with our own codes as well.