A well-formatted code favors a better reading of the algorithms, facilitating their understanding and maintenance, both for those who wrote it and for the others involved. For instance, in corporate environments and in Open Source projects, it is essential to keep the source code well structured and organized so that no one has a hard time understanding this.
Formatting the code will remove both unnecessary white spaces and blank lines, in addition to applying appropriate indentations to the entire code, making it more presentable and enabling identify clearly where a given piece of code begins and ends.
Although the formatting of the code is quite considerable and demonstrates professionalism, it isn't recommended to perform it manually. Many tools / IDEs perform this task automatically whenever you save a file or when using programmed shortcut keys to do this. If this isn't your case, you can use this tool to format all your code quickly and easily.[ Wikipedia: Pretty Print, SQL ]