Code formatting is the way to format the source code of programs, such as using spaces and tabs, improving legibility.
Formatting code, such as introducing spaces or tabs, is a fundamental rule of good programming.
In this way, it's possible to improve the legibility of source code, following the logical structure of the program, in order to separate the instructions more clearly.
Modern text editors or IDEs, such as Eclipse or NetBeans, perform functions of automatic code formatting.
Other info on Wikipedia: