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