Tip: Searching documentation

September 9th, 2009

A very quick productivity tip: add search plugins for documentation that you refer to frequently to your web browser. Even if you know your way around the documentation well, it's still faster just to search for what you want.

To get plugins, search Mycroft, which is fairly comprehensive for documentation resources. Where the documentation you want doesn't include a search engine, plugins can be found that search the documenation with Google.

Semantic Whitespace

September 7th, 2009

Perhaps a little-known feature of many applications, including most web browsers, is that as well as click-and-drag selection, you can often use double-click-and-drag word selection. There's also a triple-click paragraph or line selection that you may not be aware of. (Internet Explorer has a heuristic selection model that makes it easier to select words at the expense of making it harder to select arbitrary amounts of text.)

Though little-known, it's extremely useful! A favourite trick is to double-click and drag to select words, then right-click and "Search current search provider for".

This word selection can show up an accessibility problem. Browsers and probably some search engines identify words by splitting the content on whitespace and block-level HTML tags – not on inline-level tags! This is sensible. If I write HyperText Markup Language (ie. highlighting initials in bold), I don't want the semantic content to be "H yper T ext M arkup L anguage"!

The accessibility problem is this. With CSS it's possible to accidentally write HTML that is neatly padded to look like words, but which doesn't tokenize (split up into words) properly. For two words to be considered separate you need to include semantic whitespace. Sites as big as Facebook and Twitter still make this mistake!

If your browser supports proper word selection (Internet Explorer's word-selection model is useless here), try double-clicking near formatting changes to check that your website is semantically correct.

Try it out! Can you detect the difference between these?

withoutsemanticwhitespace

with semantic whitespace

Distributed Website Thumbnailing

July 7th, 2009

Thumbnail screenshots of websites seem to improve web usability enormously. For me, seeing a thumbnail triggers clearer and faster recognition than a domain or a name alone. Favicons also help when I've used the site enough to become accustomed to it. The GooglePreview Firefox extension is a favourite of mine for this reason.

There are now quite a number of websites which allow free website thumbnails. While these services are pretty good, and I recommend using them, these services require a huge amount of bandwidth to load the websites and serve the thumbnails, a lot of CPU time to render the websites, and a lot of storage to store them all. This means they consume money and the companies running them place a variety of restrictions on what can be done with the thumbnails. Also you very frequently find thumbnails don't yet exist or no longer exist, and the thumbnail service serves up some advertising instead, which is bad for usability. Perversely, it's for the same infrequently visited sites that it's hardest to remember that thumbnails get purged quickest.

If Google or another large search engine entered this market they could make a fast and free service that would be self-supporting. They are the only people who are making vast amounts of money enhancing the web – because a better web drives more business through their main search engine.

However, in the absence of that, I wonder if we shouldn't turn to distributed technologies to make the business of understanding where a link takes you an innate part of web standards, rather than a bolt-on service controlled by a vendor.

You could imagine a web standard similar to the favicons system, where thumbnails of the website are available at standard sizes – say 128×128 or 256×256 – at /thumbnail128 and /thumbnail256, but this places the onus on the publisher to create the screenshots and keep them up to date. Even worse, it's not a great idea to trust the website themselves. Shock sites, porn sites or scam sites could benefit from misleading users into visiting a site.

One solution might be a distributed network for website thumbnails. A lot of research and development has been done in the area of DHTs particularly to improve the performance and decentralisation of peer-to-peer networks. A client could look up a URL in a DHT to obtain a URL for a thumbnail of that website.

There is also a way of generating thumbnails in a distributed manner: web browsers. There are so many web browsers visiting so many websites that if you could tap into only a tiny fraction of them – with, say, a Firefox extension that generates and uploads thumbnails using <canvas> (assuming you can work around the privacy implications) – you could get good coverage quickly. Because it piggy-backs onto the normal web-browsing experience, it uses very little extra bandwidth than what users were already using.

File Uploads in Firefox 3.5

June 27th, 2009

Apparently, improved developer control of browser-native file uploads, something I wishlisted back in 2007, is going to be available in the upcoming Firefox 3.5.

RSS: Error-prone

June 24th, 2009

I subscribe to only about a dozen RSS or Atom feeds, but more than half of them suffer from one problem or another.

  • Intermittently dumping a dozen duplicate posts.
  • Dumping a dozen duplicate posts on every refresh.
  • Duplicating the most recent post on every refresh.
  • Double-escaping HTML entities, so I see &ldquo;, &rdquo;, &hellip; and such like in post names.
  • XML syntax errors causing total feed outage until some improperly encoded post drops off the feed.
  • <pre> code snippets that have lost their formatting.
  • And, of course, the occasional snippet of HTML that doesn't work as intended when removed from the context of the original HTML document and embedded in RSS.

I often have to search for Pipes to get a useful feed, which is a consequence of the way RSS specifies only a data format, not an obligation on producers, an architectural flaw I've discussed before.

But quite aside from this, it seems that a significant proportion of feeds aren't implemented properly.

Obviously we can blame developers for bugs, but the design of RSS may well be a contributing factor. The process of encapsulating HTML fragments in XML is not as straightforward as it looks. The requirement for a unique ID for each post at first glance does not look onerous. But does the ID correspond to the specific version of a post? Or does it correspond to the current version, however it may have changed since it was first published?

RSS may be useful, but it should also just work, and it doesn't. Developers and standardistas alike should start thinking why.

Sample Code for Employers

June 10th, 2009

If you are looking for a job programming, you need to demonstrate to a potential employer that more than anything else, you will be profitable. In terms of programming, profitable code is robust, is produced quickly, is readable, understandable and maintainable by the rest of the team, and depending on the job you're applying for, may have to be secure or efficient too.

As an employer I consider it vital to see a sample of a developer's code before employing them – it's the most reliable way of assessing how competent a candidate. The standard of code I've encountered from candidates over the past few weeks was generally weak. If you want to stand out, you may be interested in a few tips. I've tried to put these in order of importance.

  1. Submit only your own code If you worked on the code with anyone else, it's worthless to me.
  2. Submit your best code If you have more than one project, submit the best. I'm liable to judge you on the worst. The most recent code you've written is normally the best, assuming your programming skills have improved over time.
  3. Make it easy to run the code I can't run most of the code I receive. Maybe it runs, but generally it's not clear how I get it running (web applications are generally hard to run). I am interested most in the code itself, not seeing the program run, but it's a big bonus if I can run it. So why not include an INSTALL file documenting the process. For web applications, you could include database dumps with sample data, or swap your application onto SQLite and include the database file. But an even easier way is just to get it hosted somewhere and send a link.
  4. Submit code that does something interesting A lot of code is either boilerplate or performs very common tasks. For example, a web application that takes input from a user, puts it into a database, retrieves data from a database, and outputs it into a page is the most simple web application it's possible to write. It's covered step-by-step in any web programming textbook. If that's all the application does, it had better be pretty dazzlingly tidy code. But I prefer to see code that is outside the scope of textbooks.
  5. Use plenty of third-party libraries The more libraries I see neatly integrated into your software, the more efficient you look as a programmer. There can be reasons to re-invent the wheel in practice, such as to overcome license restrictions, but when you're submitting sample code to employers it makes you look inefficient. Moreover when I see code draw on more and more appropriate libraries (or web APIs, or data sets) it also means that you know what's available and you're thinking about how to combine them creatively. (Incidentally, if you bundle third-party code with the source you supply, put it in a directory called "lib" or something so that I can see to ignore it.)
  6. Write good HTML. I'm less tolerant of bad HTML than a web browser is. I'm not going to pass or fail you purely for HTML that's not standards compliant because it's enormously widespread, relatively low-impact, and fairly easy to teach – but you're applying for a job writing software that outputs in a well-defined language. It comes across better if you're actually outputting in that language, and not some misinterpretation of it. It begs the question, would you do that for any other data format or protocol? Anyway, bad HTML breeds bugs.

If you can't find code that meets the above criteria, why not write something especially? It's possible you could write something in a weekend that can improve your job prospects significantly.

But if you're not employed at the moment, and you're looking for a job as a programmer, you should be constantly either writing code or reading articles on the web about writing code. Employers can teach you skills on the job, but it costs money to do this, and that's money that won't be going into your salary.

Job Opportunities

April 7th, 2009

My company, Mauve Internet, is looking to take on staff in the Chichester/Portsmouth area. I am looking for a Django developer, so if you have experience with that, or perhaps only a little Python experience but are enthusiastic to learn more, please check out the job details or perhaps get in touch.

Mauve Internet is currently based in Chichester but I've been looking at offices in Portsmouth and Havant too, perhaps I'm even leaning that way. Also, the job spec I've written up is fairly narrow. In truth, we may have positions open for a much wider range of talents and levels of experience in the field of web design and web development. I'm be happy to consider all applications accompanied by a CV.

Exercise: Recreate an attractive website

March 3rd, 2009

I pick up a fair bit of business from companies that already have a website created by, say, the boss's son's friend who has gone off to university, but also I'm forced to use hundreds of websites that have cringingly poor design or cripplingly poor usability. I am very supportive of amateur and beginner web designers striving to improve, but when I browse the web it's obvious there are still very many web designers who don't understand what they need to do to improve, and turn out poor websites time and again. It's a widening gap: while the beaten track consists of websites that scream 2009 in both look and feel, many amateur websites are stuck in 1999.

Anyone interested in learning to design websites would do well to study the existing web in a bit more detail – look and learn, as well as practice! I'm going to present a simple exercise a web designer of any level can benefit from.

Instructions

  1. Choose a topic. Perhaps a hobby, or a movie; something you are passionate about is best, but definitely something that you can write at least a few pages about.
  2. Pick a website you personally like a lot, but nothing too simple. The idea is to stretch yourself, so pick something elaborate.
  3. Use the design of the website you have chosen as the template for a new website about your chosen topic.

What you need to end up with is an attractive website that takes a lot of inspiration or perhaps even outright rips off the website you chose as a template – but recreated from scratch. It's OK to explore a variation on the style, but don't skirt around some aspect that looks difficult. That's cheating. You might like to source images using Google or from a stock photo website like iStockphoto.

Pepsi Rebranding

February 12th, 2009

There's a hilarious document doing the rounds after turning up on reddit: a document detailing why Pepsi's new brand identity is so good. In terms of general relativity. And smileys.

Pepsi Rebranding Advice (PDF, 6MB)

As I've pointed out previously, the criteria for whether a logo is an improvement are whether it meets the design criteria and then whether you get positive feedback from focus groups. This 27-page document full of guff, if authentic, seems to have convinced the board of PepsiCo, who on this evidence must be credulous idiots. What would convince me is a 27-page document showing that a significant majority of a representative group not just like the new logo, but can associate it with the product they already know, and the values the brand is seeking to convey.

The new logo doesn't seem to have hit the UK yet, so here it is if you've not seen it:

Pepsi's New Logo

It's not a bad logo in itself. But it's no longer as unique and iconic as the old one had become. It reminds me a little of the Sony-Ericsson logo (which is prettier). The new packaging looks almost like own-brand supermarket cola. I'm sure Pepsi will throw money behind promoting this new logo. But it's money they did not need to spend. They already had a distinctive and versatile logo.

Sky News

February 9th, 2009

I don't watch Sky News but in Googling today I happened to stumble onto their site. I was amazed how poor it was compared to the BBC news website that I visit whenever I do want news.

I've annotated a copy of the Sky News homepage as of 2009-02-06 with my comments on the graphic design. This is very similar to the way I actually work when I'm working with a designer. Click the image below to embiggenify.

A critique of Sky News' graphic design (Image-heavy SVG)