Firstly I know that formatting your markup isn’t required by any specification or to validate your markup (unless there is, I haven’t heard of such a thing though) - It’s more of a personal preference, or to simply make it easier for others to read.
However, I personally feel very strongly regarding the formatting (i.e. indentation, line breaks, readability, source code format, presentation) of HTML markup source code. And it seems others do, otherwise there wouldn’t exist HTML Tidy (unless it was created for another reason which I’m also unaware of). In fact, taking a look at a few select Websites by professional Web Designers / Developers shows that they have either used HTML Tidy or have formatted their markup in a similar way to HTML Tidy to make it look more professional and readable than other’s markup source code. I realize there isn’t a standard or a rule that states you must format your markup into a easily readable format, but I think what I’m trying to say is:
Why don’t more people format their markup to make it more easily readable and professional looking? (even if it isn’t professionaly marked up code)
Or do they format their markup but something happens on the end users end when viewing the source code?
I mean, well, I’ve made the attachment below showing a screenshot of how I’ve formatted my markup to appear, this is in Microsoft Windows Notepad below. The screenshot is 1440 x 1236 pixels in size.
That is actually the source code for the home page of my personal Website apcooper.co.uk. Now, first off I meant to screenshot the source code for the specially made [URL=“http://www.apcooper.co.uk/markup-formatting-example”]Markup Formatting Example Web page, rather than my home page however, I’ve changed my home page to be very basic and really, you going on my Website (on either page) doesn’t really give me much benefit right now. The Website isn’t setup as a public Website really (just so you mods know I’m not just posting for the sake of posting my own Website link in a thread). So anyway, you can go to either URL and view the source code and both of them are very similar.
The reason why I want you to go to either of these pages and view the source is so that you can compare it with the way the source code is formatted in the screenshot I’ve attached to this thread. So then I, and you, will know if the Web host or the Web browser has something to do with formatting the markup before it gets to the end user.
The reason I want to do this “test” is because there are some Websites out there that have absolutely horrible formatted markup and I just think - Why?!
Would it not be easier to format your markup for both yourself when editing in the future and for anyone who’s interested in your markup? I personally think it’s much more professional and it would earn the person respect from myself (not that my respect for anyone matters).
Or are you on the other side of this argument? Do you think it doesn’t matter how you format your markup, CSS and JavaScript? And for those that will say “it helps stop people copying our code when people try and read it when they can’t” because again, HTML Tidy helps us by simply putting the URL in (on the online tidy services) and it shows us all of the markup neat and tidy. So I (right now, at least until I’m enlightened on this topic) don’t see the point in purposely formatting your markup in a non-readable way and if you do write your markup by hand (in whatever text editor you use) why don’t you format your markup in a better fashion?
I’d just like to be able to view other Web pages’ source code and be able to read it easily (because I can understand it, it’s simply a case of formatting the markup to be readable) and also find out that it’s valid against what the Web Designer / Developer claims it to be. It would make me a very happy Web user and I’m sure it would make others happy and make the Web a better place.
Thoughts and feedback is appreciated.
Andrew Cooper