Web development randomness

This is my place for venting spleen on a variety of topics in web development. The emphases are probably going to be on user interface design, accessibility, technology compliance, thoughts on emergent technology and maybe a bit of architecture comment as well. All is motivated and informaed by nowt but my raging arrogance and meandering experience with these things. If I'm wrong, please tell me why :-)

Good web development guide

It bothers me that many otherwise competent people don't seem to have taken the time to work out how to do this web page thing properly. So here's a few points:

  1. Use XHTML1.0 with CSS2 — it's very clean and easy and anyone who doesn't support it deserves what they get.
  2. Don't use tables for layout — on the whole divs do this much better. You still use tables for data though!
  3. Use access keys. A wonderful and little-used feature of modern HTML.
  4. Get a Web server that supports content negotiation and turn it on. See below for why this is so good.
  5. Do usability testing. Get your girlfriend to use the site and watch, or something.
  6. Write the code by hand. If you don't, forget maintainability.
  7. Include the header and footer elements via .htaccess files or PHP (or both).

Random PHP thoughts

It's struck me recently that PHP would be a significantly better language if it used strong typing — a great deal of the sloppiness and lack of functionality are related to the much-praised automatic type conversion. A case in point is polymorphic methods in PHP's rather dysfunctional object model; these would be really great but aren't possible because the typing is so sloppy. I hope they sort that out in the long-awaited version 5 — but if you're writing in a strongly typed object-oriented scripting language then why not use JSP? Hmm, must look into that :-)

CSS Wishlist

Overall, I'm a big fan of separating semantic structure from presentational markup, and the XHTML/CSS model is really very sweet — the resultant clean-up of the HTML is definitely worth the investment and dumping table based layouts feels great!

However, aside from the obvious problem that Microsoft, despite having more moolah than any other software company on the planet, don't seem capable of writing a web browser capable of rendering CSS2 (or handling PNG printing or alpha transparency properly, but I digress), there are a few annoying features of CSS. Here's a list, possibly to be fleshed out a bit as time progresses:

Content negotiation

You don't know it yet, but you want content negotiation on your website. Although designed to do very clever things for delivering the right variant of a document (based, say on the language of the requesting client) it's also excellent for masking the filetypes you use for your pages.

This site, for example, runs on PHP but (unless I've fouled up in one of my links somewhere) you won't see any .php extensions in the location bar. That's rudimentary content negotiation, and very neat it is, too. The only thing you have to be careful about is to not give any files the same pre-extension name as a directory at the same level. If you do that, things get confused and the directory "wins", meaning you never get to see the page.

What are the benefits? Well, not having the extension means that readers don't have to remember what technology is behind your pages, they just need to know the idea, provided you give each file a good, meaningful name. It'll also reduce "link rot" as your page is more robust to technology changes and means you don't have to create the directory structure from hell that would be required to do this otherwise.

Really, it's good stuff: take a look at Apache's own documentation for more info.