Best Practices for Submitting a Pull Request
Generally, a best practice to engage in before submitting your own pull request is to do a code review on your work.
Prior to submitting a PR, review your code for the following characteristics:
Is the code READABLE?
- Is it well-organized?
- Are the class, variable, and method names clear and descriptive?
- Are the formatting, spacing, comments, and indentations consistent?
- Have you refactored the code to reduce repetition and nested code?
- Have you included the appropriate comments to make your code readable to others?
Have you followed the languageās STYLE CONVENTIONS?
- Are class, variable, and method names cased and capitalized according to the style conventions of the language (e.g. camelCase vs. snake_case)
Is the code CORRECT?
- Does the code work as intended?
- Does the logic make sense and solve the intended problem?
- Have you provided instructions for reviewers to setup and verify the solution works?
Have you identified and accounted for BUGS and EDGE CASES?
Have you anticipated all the issues that could arise in your code that the person doing your code review will raise?
Do you understand every line of code you are submitting? If not, go through each line and write down questions to clarify everything you do not understand, then ask!