Skip over navigation

What is "Good" Code?

By on Jun 5, 2008 in Web Design, Web Engineering

We recently had a conversation at the office, which amounted to posing and attempting to answer the question, “what’s the best way to show our clients the value we offer with our client side coding expertise”? Using the web, we decided, is an experience that’s become exponentially familiar as we all rely upon it more and more, yet everything that happens behind the scenes, is for most people effectively still quite a mystery. How do websites really work? What is a web server? What is a database? What is the difference between client side code (xhtml/css, javascript, etc.) and server side code (php, asp, jsp, etc.) and perhaps most importantly, why should anyone care?

Of course there are any number of ways to answer these questions, but for now I’m just going to focus on the first one in the simplest way possible. Pretty pictures!

At the moment, we’re in the midst of a redesign for an existing client. Here is the code that currently renders just the navigation of the homepage:

Example of complex code

Notice how, well… messy it is?

Now here is the code for the redesigned homepage navigation:

example of simple code

Ahhhh… much better. Every line of markup has semantic meaning and serves it’s purpose cleanly and clearly. Unlike the existing site, we’re using CSS instead of javascript for our navigation rollovers and all of our style or presentation (how things look) is discretely separate from the structure (the layout) and content (text and images/graphics) of the page. Instead of a whole bunch of nested tables, complicated javascript and images, there’s a simple “unordered list” which facilitates the site’s menu. As a result, the page and the site as a whole will:

  1. Be far easier to maintain
  2. Be more search engine friendly
  3. Be accessible via screen readers for disabled users

Perhaps the best part is that the page weight and download time is cut in less than half. Not counting images/graphics, the current page weighs in at a whopping 16k while the redesigned page is only a miserly 4k. Even on a modest sized website these file sizes can add up to significant download times. Lastly, the less a server has to work to serve up code, and the less the client (receiving) machine must work to download code, the less energy is used in both directions, so proper coding also has the benefit of being “green” and sustainable!

So, good coding is better for SEO, and therefore better for your business. It saves you money and it’s good for the environment to boot. It’s just plain crazy not to do it!

Hey! This wasn't written by a murder of crows! It was written by , who does awesome work at Loud Dog, a digital branding firm in San Francisco that helps businesses express themselves authentically via identities, websites, and marketing collateral.

If you want us to do awesome work for you, if you have a question, or if you're just feeling lonely and want to chat, we want to hear from you!

Get in touch

Leave a Reply

Your email address will not be published. Required fields are marked *