Wasting BandwidthYou see how the file above is nicely formatted - the <title> tag is indented from the <head> tag? You need to do that when you're coding to make the code easily readable, and hence maintainable. But you're punishing your users unnecessarily! They have to download your extra line feeds and tabs, when their browser could care less that they are there. The file below renders exactly the same: <%@ Language=JavaScript %>
<html><head><title>My page</title></head><body>We're in "HTML mode" here...
<%
var sScript = Request.ServerVariables ( "SCRIPT_NAME" );
Response.Write ( '<p>I am called ' + sScript + '<p>' );
%>
...and here.</body></html>
|
So, the user is now happier because your page loads faster. If you don't think this matters much do a View/Source on some major sites and see the extra baggage they send out. Remove the HTML comments and the extra spaces/tabs and you'll be surprised how much quicker they download. I did this exercise on a page generated with FrontPage. It started out as a 40k file - that's a sizeable page to download at 28.8kb. I removed the indentation (which were all spaces) and the HTML comments and the page reduced to 3k. The browser didn't render anything differently, just 10 times quicker! Part 3: Readability... |