The Way I Write Clean Code
Design
Creating good architecture design.
Creating good database design.
Creating good API design.
Unit test
Write unit tests or test-drive development.
Keep tests clean.
Name
Creating good names
Don’t use literals.
Functions
Keep functions small and do one thing
Write functions as writing a story.
Code
Avoid repeated code. Extract repeated code into a common function or utility function.
Consider using better data structures and algorithms.
Classes
Keep small classes
Consider creating a better class hierarchy
Consider using a better design pattern
Error Handling
Consider possible exceptions for each line of code.