The random ramblings of a teenage web designer trying to make it big. Design, gaming, music, and life in Florida. Because everything else just isn't as good.

Thursday, September 08, 2005

Cut down on the Code

Over the past few weeks I've been doing a lot more coding then I usually do. As a web designer I often find myself taking peeks at the coding of other popular websites. Though they may look good on the outside, half of these popular sites have horrible coding. And no, I'm not talking about tables for formatting (I'll save that for another post). I'm talking about the unecessary amount of whitespace used. Now, usually this wouldn't bother me, but I find the pages I'm making have had some unusually large load times.

After a little research, a peculiar message caught my attention and sparked this post. Stu Nichols recently redesigned his website, and moved it to a new host. Somewhere down the page it mentions that the website is served as 'application/xhtml+xml', even though some browsers, like Opera, can't quite comprehend this. Basically, it means that the website is a mixture of XHTML and some PHP and/or XML coding. In Opera's case, what used to work as 'text/html' no longer functions correctly as 'application/xhtml+xml'.

Now, if you're using a basic browser like IE, FF, or Safari, you shouldn't even need to include any directions for serving content in your coding. Most browsers will automatically set that up for you based on what they see, and what is displayed on the site in question. Okay, so I've gone on my little rant. Now it's time to move on to the main point of the article. After going through many different sites looking for a fix to Stu's problem, I realized that an unusually large number of sites have increased loading times due to extra whitespace. My point; cut down on the extras. You're the one who's designed the site, so there's absolutely no need for all of the hidden comments and whitespace. All it does is increase the load time, kilobyte by kilobyte.

As a designer it's your job to know where everything is and what it all does, without having to use hidden comments to find your way. A few months ago Douglas Bowman pointed out a simple method for marking off important areas in his CSS. Simply include a large, noticable, special character in front of all your selector names. It barely harms the load time, and offers an easy solution to the problem. On a separate note, for all of those websites that try to hide your coding by hitting enter 50 times in Notepad, it isn't doing anything but making your page load slower.

And with that, I bid you all a good night. I have a few more things planned over the next few weeks, and look forward to some increased traffic and hopefully some people subscribing to my feed.

Afterthought: I just told my dad about this post, and he mentioned that the entire purpose of hidden comments is to instruct people who are viewing the coding. The whole reason I noticed the extra whitespace was because I was trying to learn some new coding tricks. This article contradicts itself, but I hope it helps some of you anyway.


Post a Comment

<< Home