So basically, you can divide it into two different parts.
Source code means the programming behind any webpage. When the programmer does the coding, its main focus is to do the easily readable code and provide the future purpose's navigational structure. So it adds the line breaks, commas, spaces, and comments in that respect.
So the formatting of the code helps you in
- Simple to communicate your intent to the reader.
- Simple to read the code.
- Quick readability and provides a navigational structure for future purposes.
But these line breaks, commas, spaces, and comments are considered extra elements in the eye of search engines, browsers, and computer machines. They take the space in the code file and make it more sizable, and on the other hand, the search engines, browsers, and computer devices have to read these extra elements when they have to crawl that file. That increases the load time.
The increase in the web page's load time hurts the user experience, which leads to a decrease in 自然优化 ranking.
It is always better to use some online tools to beautify/format/un-minify the code because it gives you the desired results within no time.