Skip to content

Clean Code Development

agrov edited this page Feb 13, 2020 · 9 revisions
  1. I used comments in my code for better readability of the user.
  2. As shown in the snapshot above,I used verbs for naming the functions in my web application.Example:functipn update,remove.
  3. 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.
  4. None of my functions have more than three arguments.
  5. 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:

  1. Be Precise.
  2. Choose Descriptive names
  3. Name methods using verbs
  4. Name classes using nouns
  5. Delete unused things
  6. Add comments for better readability of the user
  7. Make a clean structure for the project
  8. Replace Magic Numbers and Strings with named constants to give them a meaningful name
  9. Be Consistent. Use same variable names for same concepts
  10. Always unit test boundaries
  11. Avoid duplication of code
  12. Always look for the root cause of a problem
Clone this wiki locally