He is one addition to naming conventions when it comes to private fields.
There are two things that you will see when you take a look at source code of other developers write.
So let's create a private string field here.
Private string.
Uh, for example, customer name equals to John Doe.
This is what you could see, right?
John Doe it's a private field written in CamelCase.
But another convention is that you add an underscore.
So it's an underscore, uh, camel case.
But why is that important?
Well, that naming convention exists and you can use any of them because of the constructor.
So if we could create a constructor here and we would receive a value here, just for example, the
customer name.
Right.
Just like that.
And as you know, our uh, properties or arguments are written in camel case two, you can now use customer
name and you know, oh it's an underscore.
So it's the private field equals to customer name.
Right.
You can do it that way.
This one is getting used quite often.
But still I want to tell you that it is okay if you want to do it that way.
But now we have a conflict right.
So our private field here is using the camel case without an underscore.
And it has exactly the same name in the convention like our parameter here.
So we have a conflict.
And in order to solve this you can use the this keyword.
So for example this customer and this now is related to our private field.
If you hover above that you can see that this is related to the field.
And then the customer right hand side is related to the parameter right here.
And since this was confusing for some developers, well, at least I think that might be the reason
they decided to just add a new naming convention, which is adding an underscore for private fields
just to solve this.
But as I said, both of them are valid.
And here there are decisions on or you have to do it that way or you have to do it that way.
But on developing software for more than ten years now, and I've seen it both ways in big as companies.
Alrighty.
So let's move on to the next lesson.