Alrighty, so let's get started with some clean code basics first, right?
And that one here is really obvious.
Probably you have seen and heard that before, but that's a sweet warm up.
So let's get started.
The first part is talking about clarity and precision in naming, and this is best explained when we
just create the bad example here first.
So let's create an integer variable inside of our program main and let's simply call it n.
And then let's assign a value.
This one is bad.
Another example would be string.
Let's call it's and we set the value to John.
So this is a negative example.
So how we should not do it.
But why.
Well this is best explained if you assume that someone else wants to see your code.
If you are a developer, chances are that you will work inside or as part of a software developer team,
so someone else will take a look at your source code every now and then.
And your goal should always be to create code, which is as obvious as possible.
So if someone takes a look at those two variables right here, does he know what's going on?
Well, he could assume that string s could be for a name.
Right.
But int n is like is not predictable.
He cannot tell okay.
What is n is n for.
Here is n for student count or whatsoever.
So what you should do instead would be.
And that will be the good practice to provide great names for the purpose of the variables, methods,
classes and everything that you create inside of C sharp.
So a good example would be int.
Then student count equals to 100 for example.
And string student name equals to John.
Now the developer knows or whoever takes a look at your source code, even if it's just you in a few
months ago, you will come back and see student count and student name and you will know.
Alrighty, there are 100 students and the student name is John for example.
So the name should always be an indicator for the purpose of the variable, method class or whatever
you create.
Alrighty.
So when you choose names, always choose short names.
Okay, that's totally fine, but never skip them for purpose, right?
So always choose names for your variables, properties, classes, interfaces and methods and everything
as you create which provide as much clarity and precision as possible.