Few Tips on Code Structure of a Quality Website

Well, that’s a tricky question. What exactly is it that defines good code? Is it whether it validates? Is it something that works on all browsers? Is it code that performs well in all the search engines? Or is it code that is well commented and easy to understand if you go back to it 6 months after you originally wrote it?

I think it’s a combination of all of these things.

The web design group thinks your pages should validate.

Market Position thinks your pages should validate.

HTMLValidator.com think you should validate your pages (obviously ; )…

So why is validation so important?
Validation means that you know that the code you have written (Or produced in a WYSIWYG editor if that’s your thing) is free from any errors. “Great!” I hear you say, “but who cares?”. Well, lots of people. Page validation should mean that your code works well on all browsers out there (This isn’t always the case, but most of the time it is true). It means that your site SHOULD be on the way to becoming more user-friendly for disabled internet users (Which is REALLY important). It should also mean that none of your code is spurting out onto the page where it shouldn’t be, and your pages could also load a little quicker (depending on how much code bloat we are talking about ;).

People are also saying that because of the security risk involved with using internet explorer now, more people will be looking for alternate browsers, which is another reason that you should be validating.

You see – validating your pages doesn’t just mean that you can put that cool W3C link on your site after all! You can take the help of SEO tools to find the various validation checkers.

Why is commenting on my code so important?
It isn’t really. That is, if you don’t mind working with code that you just don’t understand. Making comments in my code helps when I have to return to something 6 months after I wrote it. It means that I can just pretty much pick up where I left off from.

This might only be for me… For all I know, you have the brain capacity to remember pages and pages of code for years without ever having the slightest problem with working out exactly what it all does…

But if, like me, your memory leaves something to be desired, then I suggest you comment on your code.

To be honest, though. As long as the code is clean (Not too bloated with crap), then I’m sure that you will be fine.

Just do some cross-browser testing to ensure that the site looks good no matter what browser you are using…

That reminds me… I have to go and test ie4 now ; )