C# Clean Coding Practice, always use proper naming conventions
🚀 C# Clean Coding Practice 💡
🎯 Use Proper Naming Conventions
Naming your variables, classes, and methods effectively is crucial for writing clean and maintainable code. Following coding conventions not only enhances readability but also serves several key purposes:✔ Ensures consistency in code layout, allowing readers to focus on the content, not formatting.
✔ Helps others (and yourself!) understand the code more quickly based on familiar patterns.
✔ Simplifies the process of copying, modifying, and maintaining code.
✔ Promotes adherence to C# best practices.
Check out the table below for standardized C# naming conventions to follow when writing code. Let's keep our code clean and efficient! 💻✨
Object Name | Notation | Can Be Plural |
---|---|---|
Namespace name | PascalCase | Yes |
Class name | PascalCase | No |
Constructor name | PascalCase | No |
Method name | PascalCase | Yes |
Method arguments | camelCase | Yes |
Local variables | camelCase | Yes |
Constants name | PascalCase | No |
Field name Public | PascalCase | Yes |
Field name Private | _camelCase | Yes |
Properties name | PascalCase | Yes |
Interface | IPascalCase | Yes |
Enum type name | PascalCase | Yes |
If you find anything inappropriate please report it here.