I am often reminding people who are asking me to help them with coding their sites to keep the code clean. Saying this may not make sense to most people but it is important to a websites success clean or broken code can cause the site to load slowly or even make some of it not work properly.
You may be asking what is “Clean” code, some of it is personal preference like indenting your code or putting white-space before or after section of it – won’t effect your “page speed” , but are up to the programer ( I like to indent my code and put the white-space in because I find it easier to read ).
The biggest problems from “Unclean” code is that tags get opened , but not closed or closing tags without a proper opening tag, many Browsers will close tags for you if they are left open, but it takes time for the browser to figure out which tag needs to be closed causing the page to load slower.
And there are other things that I have seen, such as too much code like < p > (“Paragraph”) tags inside < h1 > (“Heading 1”) tags, empty < p > tags or multiple < br / > ( “Line Breaks” ) to push elements around adding lines of code that is not necessary.
The last thing I want to mention is using “Absolute” links for you < a href > (“Hyper Links” ) some people say it is not important that your links are “Absolute” but I found if you don’t make it a point mistakes can pop-up, like missing http:// at the begining of the link, causing the link to appear as “Broken”, this may also happen if you are using “../” to point to a page with a “hyper-link” it may show with “Google” as a broken link, and then you have to go back and fix them to clear out your “Broken Links”.
With “Clean” code, your site will load faster and your website design will work better for everybody.