Why refactor a web site? You don’t always have the time to redesign your website from the ground up. Your web site uses outdated HTML and web technologies, loads slowly and needs search engine optimization. Today’s web sites need to load fast, display on multiple browsers and mobile devices and utilize current web standards. A slow loading web site means that your visitors will not wait for your site to load.
Refactoring means changing your web site’s structure to make it easier to read, maintain and provide the user with a better experience. It gives you a chance to fix that one issue that bugs you about the web site.
What items should you look for?
- Outdated HTML As more developers use HTML5, you’ll want to remove HTML tags that are no longer in use. Tags like <center> and <font> are not depreciated in HTML 4. In HTML5, tags like <blink> and <marque> are also depreciated.
- Unnecessary code When you have code embedded in your site, you need to determine whether or not it really belongs there. As browsers and HTML changes, old hacks can be removed because the browsers now support a technique that originally required you to create the hack.
- Embedded styles Styles embedded in HTML tags make it difficult to change the look of your site. If you want to create a new look, you have to edit all of the embedded styles. By moving the styles to an external CSS file, you can change the look of your site more easily.
- JavaScript When a browser encounters JavaScript, it stops to handle it before loading the rest of the website. You want to evaluate each piece of JavaScript on your site. Does it need to be there? Can you use CSS or another technique that works better? Should you move it to the bottom of the web page so that the page can load faster?
You don’t need to take care of all problems at once. Even a small change like moving JavaScript code to the bottom of the web page can improve the overall experience for your visitors.