Programming

Monday, June 26, 2006

Never, ever ever let Microsoft manage your partitions. I made a fatal mistake of clicking "upgrade volume to dynamic". Not knowing what the true horrible implications of this was, I foolishly clicked "yes". No warnings that this was an irreversible process. Then suddenly had to reboot. The machine blue-screened first time, until I went into partition manager to fix it. It now boots fine.

However the disk is now borked in a proprietary format that I can't do anything with except wipe it and start again. I can't find the "dmunroot" utility which wipes all other partitions anyway.

Luckily it is my spare machine, but it will take ages to set up again.

Microsoft's attitude is "why would anybody wish to downgrade?"

A comparison of programming paradigms

Why is object-oriented programming (OOP) so popular?

It is often said that OOP "models the real world". I would argue that this is not true - OOP models the way we think. That sounds radical, however the way we perceive the real world is via the way we think, so there is not such a huge difference after all.

OOP also models natural language. There are nouns (objects), verbs (methods/functions), adjectives (properties) and adverbs (parameters). Natural language is also closely related to the way we think.

Functional programming is more abstract, because although solutions can be more elegant, it does not lend itself quite so naturally to human thought. People think in terms of concrete things that they can push around, so stateful languages are therefore easier for our brains to manage.

Logic programming languages are even harder to write complex algorithms in. The problem as as soon as you have recursion, your head needs to start abstracting again, and it's difficult to visualise too many things at once. At least with functional programming you have inputs and outputs, which are concrete things - with logic programming you have partially-filled in inputs and outputs and algorithms can frequently be run in reverse.

For expressing simple problems, logic programming can express things very nicely, since effectively the program and the data are combined. Predicates are data that are executable. However you still need to understand the execution model and backtracking to achieve non-trivial tasks, and this is where logic programming falls down. For example, implementing a merge-sort algorithm in Prolog (which I have done) is very satisfying but I can't help thinking that it is out of reach for the average programmer.

For simple, declarative tasks, I don't really consider that to be programming since there are no algorithms involved. I would not class data transformation as programming (though it is of course an extremely useful activity).

Imperative styles, do A, do B, do C, are pretty easy for our brains to manage. Therefore, scripting languages, and procedural languages are pretty popular. However OOP takes this one step further by creating objects that react to things, rather that data which is operated on by a procedure. Objects reacting to things is an easier way to think about things since it models our own perceptions of the world.

I therefore argue that the relative popularity of programming paradigms comes from the ease at which the paradigms can be used, which in turn comes from how natural we find the language. If you require an IQ > 130 to master a paradigm, perhaps the paradigm isn't so useful after all.

Wednesday, June 21, 2006

About a week ago, I was wanting to assert whether a piece of code was running inside a database transaction. My suggestion to my tech lead was: why not use the type system to ensure we have a transaction object.

The response from my ever curt tech lead was: we don't need to know that. Stupid me.

Today my wonderful tech lead suggested that we use the type system, and looked very proud of himself. It's nice to know my emails just get ignored.

Friday, June 16, 2006

Usability?

I've recently tried to submit my paper to VL/HCC 2006. The good news is that I got a paper accepted, the bad news is that it's only a short paper, the conference is quite expensive and seems to last all week. So this is larger dent out of my money/holiday budget than I wanted. Still I've worked on Visula for a while (as a background task) so it makes sense to write it up. On the brighter side, I don't need to talk for so long :-/

So today is the deadline. I've been very quiet recently since I've been trying to condense 8 pages into 4, and now it's ready.

The instructions to submit the paper are long and infathomable. The login process is protracted. The links in the page have broken icons. A link to submit the paper is missing. An instruction to fix the link is also infathomable and refers to boxes that don't exist. The upload process is slow and error-prone. The PDF verification process has a really shitty UI. After a few attempts, I get my PDF verified. The submission link just takes me back to the start. Then this morning, the entire site has crashed due to lack of disk space on the server. I still have no fricking clue how to submit the paper, I'll randomly click some more when the server comes up. I emailed the tech support yesterday with no response.

My next usability hurdle comes when I need to register for the conference. This website seems nice and clean. I enter a few details, hit a button and get a blank screen. Bam. Nothing. Try again, same result. Apparently I should fax a non-existent registration form to a non-existent fax number.

Now, the irony of the situation is that this conference is concerned with usability and human-centric computing! Still it's not too late to withdraw...