Reusable Code

Photo by Buddha327

It is often said that good coders write code from scratch and that great coders reuse code. If that’s the case then it appears I’m a great coder. I have about 4 or 5 different xHTML/CSS layouts which I am constantly reusing because they are just solid, cross browser layouts which can be modified and tweaked to suit most designs.

Most designs follow similar principles; a header, 2 or 3 columns and a footer. Therefore there really is no need to reinvent the wheel. As well as being time-saving, it is also a matter of consistency and ensuring that the quality and backwards compatibility is built into the templates.

This ability to manipulate templates really comes down to separating content from style and harnessing the power of CSS. Being able to keep underlying xHTML code exactly the same, and to change the design through just CSS is something that even today, some designers can’t grasp. All too often I see in-line styles where it’s not necessary and this makes updating a site very laborious, tedious and time consuming.

To see what I’m getting at, a great project by Dave Shea called CSS Zen Garden was started to really flex the muscles of CSS. Although this project is relatively prehistoric in Internet terms, it still attracts a lot of attention. This is how the web should be built, with semantics and accessibility in mind, however there are far too many Web Design companies that just don’t care about the ethics of the work they do, just so long as they get paid.