C# Coding Standards

1. Use Pascal Casing for class names and method names.

2. Use Camel Casing for variable names.

3. Use meaningful words for variable names.

4. Do not use KEYWORDS for variable names and class names.

5. Do not use underscores (_) for local variables.

6. Use Pascal case for file names.

7. File name should match with class name.

8. Use the  prefix "I" with Camel Casing for Interfaces.

9. Write only one statement per line.

10. Write only one declaration per line.

11. Comment lines should be in the same level as the code.

12. Curly braces ({})should be in the same level as the code.

13. Use try-catch statement for exception handling.

14. Use #region to group related code.

15. Method name should tell what it does.

16. Method body should not be very long instead separate method in another method.

17. Use String.Empty instead of "".

18. Use StringBuilder class instead of String.




No comments:

Post a Comment

Thanks

SQL server tricky questions