From the course: C# Best Practices for Developers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Field and property naming conventions

Field and property naming conventions - C# Tutorial

From the course: C# Best Practices for Developers

Start my 1-month free trial

Field and property naming conventions

- [Instructor] So, I've mentioned quite a bit about classes so far. Right now, we are in our actor test class. Let's go to our actor class. The thing that I'd like you to keep in mind is essentially what the class is. As an experienced programmer, which I'm assuming that you are, we know that classes define a template that specifies the data and the processing for each entity in our application. It's possible we could have another class in this file here, but it only makes sense organizationally to just have one class. Now, fields and variables in a class hold data for each object traded in that class, and fields in general should be private. You always want to have them protected. So, I'm returning the value Actor here, but I could have easily had a private field that's a string with jobTitle. The standard is to have fields as camel case. And below here, I can have jobTitle equals Actor, and return this as a jobTitle. However, we always want to be able to have our field possibly be…

Contents