Archive for March, 2005

Someone Should Write This

Wednesday, March 23rd, 2005

I want an online TV guide with tagging.

Sites like Yahoo TV Guide (I refuse to add the exclamation mark) are okay, but don’t tell you much about a programme, except the few sentences the production company supplies.

What if anyone could add tags to a programme? So after I watched a programme containing, say, footage of September 11th I could tag it “wtc”. Or a programme that mentioned the Rugby World Cup could be tagged “wilkinson”.

Then anyone could search for the tags and see a list of all the programmes in the last week that mentioned the WTC attacks, or Jonny Wilkinson. Or both.

This would really come into its own when the BBC Creative Archive comes online. You could subscribe to an Atom feed for your chosen tags, and automatically download programmes that match them.

How cool would that be?

Question

Friday, March 18th, 2005

Is there a word to describe words and phrases that are taken directly from a foreign language? Examples would include cliché, deja vu, fait accompli, cul-de-sac, faux pas, etc etc.

HELP

Wednesday, March 16th, 2005

This will destroy your productivity and waste your day. You have been warned.

Pointer Hurdles

Wednesday, March 16th, 2005

At Joel On Software there’s a great article about how to interview for programming jobs, which includes getting the candidate to write some code, on paper, in the interview.

For programming questions, I ask candidates to write a small function in C. Here are some typical problems I would ask:

  1. Reverse a string in place
  2. Reverse a linked list
  3. Count all the bits that are on in a byte
  4. Binary search
  5. Find the longest run in a string
  6. atoi
  7. itoa (great, because they have to use a stack or strrev)

And here are some of the things he suggests looking out for:

  • Is their function fast? Look at how many times they call strlen. I’ve seen O(n^2) algorithms for strrev when it should be O(n), because they are calling strlen again and again in a loop.
  • Do they use pointer arithmetic? This is a good sign. Many “C programmers” just don’t know how to make pointer arithmetic work. Now, ordinarily, I wouldn’t reject a candidate just because he lacked a particular skill. However, I’ve discovered that understanding pointers in C is not a skill, it’s an aptitude. In Freshman year CompSci, there are always about 200 kids at the beginning of the semester, all of whom wrote complex adventure games in BASIC for their Atari 800s when they were 4 years old. They are having a good ol’; time learning Pascal in college, until one day their professor introduces pointers, and suddenly, they don’t get it. They just don’t understand anything any more. 90% of the class goes off and becomes PoliSci majors, then they tell their friends that there weren’t enough good looking members of the appropriate sex in their CompSci classes, that’s why they switched. For some reason most people seem to be born without the part of the brain that understands pointers. This is an aptitude thing, not a skill thing – it requires a complex form of doubly-indirected thinking that some people just can’t do.

I totally agree with this: pointers and pointer arithmetic represent a specific level of skill that allow you to say confidently either “this person has no hope as a programmer” or “this person gets it“.

However, I think you can extend this idea further. I’ve found that there’s a second hurdle, beyond which lie the really good programmers. That hurdle is function pointers.

There’s something about function pointers that many otherwise-good programmers just don’t get. Ask them to define and initialise an array of function pointers to factory methods, and index into the array to instantiate an instance of the appropriate type, and they’ll be totally lost. They just won’t get it. They’ll write reams of bug-free procedural code when a simple function pointer would have saved them hours, and made their code vastly more maintainable and extensible.

SCO vs IBM Summary

Wednesday, March 16th, 2005

Right on cue, just as I was starting to lose track of where we’re up to, Groklaw produces a lovely Summary of SCO vs IBM.

(It’s still causing much amusement in the office).

Object Oriented C

Tuesday, March 15th, 2005

An excellent article about how to use encapsulation and polymorphism in C programs.

Note that these techniques are basically what the first C++ compilers used (they were purely preprocessors which generated C code). Similar techniques are also used in parts of Linux (such as the filesystems subsystem).

Photos From Ground Zero

Monday, March 14th, 2005

Wow, these photographs are quite amazing. Retrieved from the CompactFlash card inside Bill Biggart’s crushed camera underneath the second WTC tower, Bill died taking them.

Why I Work Where I Do

Friday, March 11th, 2005

Overheard at work today:

“But Linux is sexy!!”

Ugandan Discussions

Friday, March 11th, 2005

Here is a great site which has an archive of every Private Eye cover, from 1961 to the present day.

Giant Steps

Friday, March 4th, 2005

This [uses Flash and sound] is so, so, cool it almost hurts.

Worth the wait to download it, I promise.