Tuesday, November 20, 2007

Programming Truths

Repeat after me:
Programming is difficult

Again, for effect:
Programming is difficult


Here something else to ponder about:
Just because the computer seems to do what you wanted it to do, does not mean you've written the program correctly.

A analogy to a pack of cards that collapses because one card wasn't properly placed at the bottom is helpful to understand the above.

And above all:
If your code isn't working, it's not perfect.

Never come up to me and tell me "My code's perfect, but it's not working". Please re-parse that sentence to understand how silly it is. I've lost count of the number of people who tell me that. The computer makes mistakes, but more often than not, your code's not right. Let alone perfect.

And yes, of course:
Perfect code is a thing of beauty.

Never forget that.

Monday, November 12, 2007

Supporting Linux

Many of my friends have recently switched to Ubuntu, making me the tech-support guy again. Not that I like to play that role, but if there's something new to learn, then I'm game!

Unfortunately, the support has largely been anti-climatic. When the wireless wasn't working on a friend's laptop, he lugged it to my lab, only to find out that the "wireless enable" switch was off. Turning it on got it working immediately.

Another friend recently installed Ubuntu, and he has a TV tuner. It worked out of the box, except that there was no sound. We finally tracked it down to a mute AUX mixer control. Raising the volume there got that working again.

The second could be attributed to bad defaults -- the AUX control isn't shown by default, and is muted too, but frankly there are no sane defaults in this case.

Thankfully both of these friends do read manuals and explore, so helping them is not quite the pain it usually is.

There have been more "complex" problems that I've handled, installing the Flash and Java plugins on a 64-bit machine. Neither are officially supported (Java's 64-bit JRE ships without the browser plugin!), so problems are to be expected. For Flash, nspluginwrapper worked like a charm, but for Java, the only recourse was a custom 32-bit install of Firefox.

Tech support is boring, especially when you've done it again and again. And these days, if the problem is something that Google can solve, I refuse to solve it. Sometimes rudely.