General principles of good code:
- Don’t Repeat Yourself**(DRY)**
- Comments Where Needed
- wirte specification
- specifies the provenance or source of a piece of code that was copied or adapted from elsewhere.
- Avoid Magic Numbers
- One Purpose For Each Variable
- Use Good Names
- Use Whitespace to Help the Reader
- Don’t Use Global Variables
- Methods Should Return Results, not Print Them
Reference
[1] 6.005 — Software Construction on MIT OpenCourseWare | OCW 6.005 Homepage at https://ocw.mit.edu/ans7870/6/6.005/s16/