Clean Code and Smaller File Sizes

Websites can be made in a huge variety of ways and most include elements such as tables, divs, CSS and javascript.  Whatever method you use, there are many benefits to keeping your code clean (IE, free from errors and unnecessary code).

Whenever we create pages, we ensure that the HTML code is valid to W3C standards.  Some SEO companies consider this to be an essential optimisation technique, but the truth is it’s more of an exercise in best practises as it can help safeguard against issues with browsers and robots.

One major benefit to clean code is ensuring that your pages’ file sizes are kept to a minimum, which in turn will improve page loading times.  Ensuring all javascript is kept in separate files for example can significantly reduce file size and in some cases, I have reduced the amount of code on a page by over 50% by doing this alone.  The same also applies to CSS, which should be kept in separate style sheet pages where ever possible.

Divs are preferable to table structures as they tend to involve less code and are generally easier to work with.  However, it is not always advisable to rework pages that have been created in tables as the benefit does not always justify the amount of work involved. Meta structures may also contain a large number of redundant tags that provide no benefit whatsoever.  These may be small sections of code but they are in a prominent position and they all add up.

“Cleaning” your site’s code is often a very simple and fast process and in some cases it can make a huge difference. As a general rule, the larger the file size and the longer the load time, the more important this process is.

Leave a Reply