-
Notifications
You must be signed in to change notification settings - Fork 0
Clean Code Development
agrov edited this page Feb 13, 2020
·
9 revisions
- I used comments in my code for better readability of the user.
- As shown in the snapshot above,I used verbs for naming the functions in my web application.Example:functipn update,remove.
- I created separate folders for CSS, HTML, Javascript, data, etc. so as to find similar files at one place and giving my code a clean structure to work with.
- None of my functions have more than three arguments.
- As shown below, the naming of variables in my code is intuitive.
Below are a few points from my cheat sheet for clean code development:
- Be Precise.
- Choose Descriptive names
- Name methods using verbs
- Name classes using nouns
- Delete unused things
- Add comments for better readability of the user
- Make a clean structure for the project
- Replace Magic Numbers and Strings with named constants to give them a meaningful name
- Be Consistent. Use same variable names for same concepts
- Always unit test boundaries
- Avoid duplication of code
- Always look for the root cause of a problem