Join Reynald Adolphe for an in-depth discussion in this video Field and property naming conventions, part of C# Best Practices for Developers.
- [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 accessible to outsiders,…and that's where properties come into play.…
- Naming and handling classes
- Running a unit test
- Using constructors
- Naming and handling methods, fields, and properties
- Using properties correctly
- Managing objects efficiently
- Common design patterns as best practices
Skill Level Intermediate
1. Best Practices: An Overview
2. Naming and Handling Classes
3. Naming and Handling Methods, Fields, and Properties
4. Managing Objects Efficiently
5. More Best Practices Resources
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.