Make Long Lasting Websites
Posted on 2014-07-08
After creating websites for nearly fifteen years, I've seen some great ideas that have been incorporated into the web, and some terrible ideas that have flown by with a resonating "whoosh" sound and skidded to a halt in a cloud of irrelevancy.
The latest short-lived fad is abusing Javascript for all aspects of your website's functionality. A new version of using javascript:
in an anchor's href attribute, this involves making Javascript glue your site together after loading. There are many Javascript frameworks and templating engines that make this mistake.
Maybe I'm just getting old, but... really? Are we going to go down this path again?
I, for one, am not interested in fads. I build solid, reliable websites that will still work in ten years. You should too. I'll even show you how it's done.
Progressive Enhancement
You can use the latest and greatest technology as long as it isn't crucial to making your site work. Make sure to have a sensible fall back, and make sure nothing is hidden behind newer Javascript functions or CSS effects.
Once and a while, go on a retro-roadtrip; open up an old browser. Check out your sites. Can you still get basic functionality out of old tech? Is your site comprehensible using a text-mode browser like elinks?
It may sound crazy, but with Google Glass and wearable computing, we may not be using screens for much longer. Try running your website through a screen reader, and see if things are still usable without the visuals provided by CSS. This gets into accessibility territory, and there's a very good reason for that.
Do Not Depend On The Whole Stack
If your site renders as HTML, either via server-side processes or static site generators, then your content will probably be available to whoever wants to view it. HTML is extremely forgiving; broken or misunderstood HTML will generally not make your page unusable.
CSS is ignored when it is not understood. As long as you are careful to avoid conditions where a site is unusable without it (ie: white text over a linear gradient background, which would be white-on-white if the gradient fails), you can get away with an awful lot of CSS not working.
Javascript... well, Javascript is more complicated.
Build Websites, Not Javascript Apps
Javascript is capable of doing amazing things, but like all great power, it can be abused. Javascript frameworks and templating engines that render normal, static HTML content with Javascript is a classic case of abuse in my eyes. It is an unnecessary layer of complexity that will cause huge problems in the future when Javascript continues to evolve, browsers continue to update, and your site will disappear silently behind a rendering error.
If you are using Javascript that renders or reveals your content, you are creating the new version of a flash-based website. You are doing it wrong, and you are hurting yourselves and your visitors.
Serve up your content with HTML, statically or via a server-side technology. **HTML was created specifically for this purpose! Use it! **