My view source code looks like this:
While its like an open book - an hacker can just read it with a glass of coffee, very comfort and understand everything he needs and play with it.
While Facebook, in constrain, source code makes the hacket SWAT! in order to understand something. Which reduce 90% of browser injections.
See the image below of FB view source:
How did they do this? It's like a tornado!
To reduce the readability of the code, one can:
What facebook does there is not really advanced, google is much uglier still. Be aware though that neither of this will prevent any malicious user to try to hack your site. Obfuscation (that's what these concepts are named) does not technically improve security. You have to ensure your backend is not vulnerable when it gets requests that would not normally be possible using your HTML.