From the course: C# Best Practices for Developers
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Field and property naming conventions - C# Tutorial
From the course: C# Best Practices for Developers
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Project setup overview1m 13s
-
Set up the business layer2m 18s
-
Running a unit test3m 13s
-
Class naming conventions and standards5m 2s
-
Field and property naming conventions4m 22s
-
Using constructors3m 9s
-
Unit testing constructors4m 30s
-
Namespaces2m 48s
-
Static classes3m 10s
-
Unit testing static classes4m 20s
-
Using a singleton2m 6s
-
-
-
-
-