Hello and welcome to this lecture in this lecture.
I'm going to go through some guidelines that you can use in naming your variables.
The first is a variable name should contain at least one alphabetical character a variable name can
not start with a number.
You can't name a variable name say One two three four or four or five and then a letter.
You can't do that the next a variable name should not or must not contain spaces.
So if you have variable names that are made up of one or more words you cannot leave spaces between
the words when naming variables you cannot use reserved key words.
So there are some key words that are used by the C sharp programming language and they are also used
by the C sharp compiler.
You cannot use those as variable names.
I will I will show you a list of some of the key words shortly.
Your variable names should not contain known alphanumeric characters other than a dash and an underscore.
So you can use non alphanumeric.
However you can use a dash and an on the skull.
So this is some information from the Microsoft MLC insight and is relating to the C sharp keywords if
here on the first line here it tells you.
Key words are predefined they are predefined they are reserved identifiers that have special meaning
to the compiler so you can't use them they cannot be used as an identifier in your program on less they
include the act as a prefix for example at if if a valid identifier but if not because if it's a keyword.
So these are some guidelines you can go through it at your own convenience.
So that's a link there.
Oh you can type in C sharp keywords in your search engine.
It should give you some more information so let me just browse through so you can see I'm telling you
here that the first table this first table here is a list of key words that are reserved.
Identify identify mean you use it to identify something the identifiers in any part of the program.
So this is the first tables so these words you can't use.
You can't call your variable for example abstract has Baz bool char class you know if you go to for
each n and so so you can't if you try the your visual studio will complain you will have a red squiggly
lines on the net and you will not go for a home bite so you can use it won't let you use it anyway.
So these are they just go through them so you can't use any of these or when you tried to create a variable
name you get the red squiggly lines in your features do you just know that is not happy.
So again this is the kind textural keywords says contextual quick keyword is used to provide a specific
meaning in the code but it is not a reserve key word in C sharp some context shows key words such as
partial and where have special meaning in two or more contexts.
So the key one really is this table here you need to focus on.
Okay.
All right let's go over.
Let me open up the visual studio.
Let's have a look and just try and see if we can use a variable name that is not allowed.
All right.
So this is some of the code we've used before in Kuwait in our first app say if I come here way we've
got I just tap down and say I wanted to create in another variable and I wanted to be a string.
So I type a string followed by the word for you can see the squiggly line because that is the reserve
word.
You notice it's turned blue.
OK.
So most of these words in blue you can't use them because they're all reserved in notices turn blue.
That means I can't use it.
OK.
So let me try something else you know I know I said you cannot use a number.
If I try one
name.
Yeah.
No this is not happy with that because I can't.
You can start a variable name with a number.
OK so that's just some guidelines.
So the visual studio will also give you a guide as to where you're going wrong.
If you're trying to create a variable with a name that is not allowed you get those squiggly lines and
that should give you a clue.
So that is it for this lecture in guidelines to how you name your variables.
I hope he has been helpful.
Thank you.
Bye for now.