A clean code is a code that is a combination of principles that will help you write a code that others would understand and contribute to. It also helps you understand your own code after a long time. It is hella important in group projects or in methods like Agile. A code that is not clean is dirty code.

KISS

Keep It Simple Stupid. Don’t make the code too complicated and keep it simple.

Readability

When the code is more understandable it needs less time to be fixed.

Correct naming

It helps the searching in different parts. The name of a class of a function should be compatible with its usage.

Managing arguments

Functions shouldn’t get too many arguments. Also it’s better to break the body into different pieces and put them in different functions. (Don’t put all of your eggs into one basket.)

Less comments

The code should be that explicit that it doesn’t need too many comments. If there are too many comments, you’re probably doing something wrong.

The right Language

Choose a language that is more optimal for the issue you’re dealing with. (I mean the issue you are writing a code for.)

Read it Again

Go through your code again so that others wouldn’t have to do small and basic fixes.

Reduce dependencies

There should be less dependencies in the project so that changing and maintenance is easier.

Testability

Your test should be testable from all practical perspectives. A code that can’t be tested is not a clean code at all.

Reduce the body of functions

The functions should be short and adequate. Maybe some parts like some loops are used in different parts of the code. Put them in a separated function to avoid too many lines in your current function.

Back-End

Source