C# Best Practices for Developers
1h 44mIntermediate2018-06-05
Authors

Reynald Adolphe
Technologist and .NET Developer
Course details
Get into the habit of developing reliable, readable, and sustainable application code by following coding standards with C#. In this course, join instructor Reynald Adolphe as he shows how to go beyond the language syntax and master best practices that can help you produce high-quality C# code. Throughout the course, Reynald shares some of his favorite best practices, illustrating precisely when and where to use each one. Learn about right way to use constructors, manage objects, implement often ignored advantages of getters and setters. Plus, explore best practice resources, including those for essential design patterns.
Learning objectives
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
Learning objectives
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
Skills covered
C#FoundationsProgramming LanguagesMicrosoftSoftware Development
Concepts
Introduction
- Welcome
- What you should know before watching
- Setting up the Development Environment
Best Practices - An Overview
- Best practices defined
- When to use it
- Getting the team to follow
Naming and Handling Classes
- Project setup overview
- Set up the business layer
- Running a unit test
- Class naming conventions and standards
- Field and property naming conventions
- Using constructors
- Unit testing constructors
- Namespaces
- Static classes
- Unit testing static classes
- Using a singleton
Naming and Handling Methods, Fields, and Properties
- Method overloading
- Unit testing without parameters
- Unit testing with parameters
- Method chaining
- Constants vs. read-only fields
- Using properties correctly
- Using properties demo
- Auto-implemented properties
- Auto-implemented properties demo
Managing Objects Efficiently
- Initializing objects
- Related objects needed once
- Related objects needed always
- Related objects needed sometimes
- Checking for null
- Using statement for efficiency
More Best Practices Resources
- Web and DB best practice resources
- Common design patterns as best practice
Conclusion
- Next steps