How to make your colleagues’ lives easier while reviewing your codes?
– Please just follow the naming convention.
For me personally following the Naming Convention is a basic manner and a friendly way to treat someone who will read your code. It reflects that you have attention to detail and logical thinking. It’s also one of the criteria to determine your coding quality.
My training manager had said something about this, ‘I will see whether you are a professional developer even your code doesn’t even work’.
Some bad examples and some tips:
- Do not give full and descriptive names. eg. FController or FinController instead of FinanceController. Avoid using unknown acronyms is necessary.
- Pascal Casing is important. E.g. ProductCategory, ChildProgram
- Do not provide comments on the code which may look confusing. Provide comments on your assumptions is effective.
- Use new lines to indicate a new logical group.
- Always Indent the code properly
- Use Ctrl+K+D to auto-indent your code in Visual Studio.
- Retain consistency in styles.