Eff Seven

why watch the sports channel, when you can watch cnn?

Eff Seven random header image

Point-free

January 20th, 2008 · No Comments · Photos

I was thinking about how I approach my ideas for applications and coding today, only to come home and find this post waiting for me on a nearby blog. If you click on the image near the top, you’ll see a chart that may be a bit obtuse if you’ve never programmed before. There’s a really lovely diamond about halfway down the central column - it says “Is Code 1 Line?” with a “No” branch leading off and around to rewriting it again. I found it very funny indeed, and here’s why:

When you start a course in Computer Science at Imperial, you’re first taught the functional programming language Haskell. You learn the heart of coding here - recursion, pattern-matching, conditions and so on - and although a good chunk of the year are happy to see the back of it, there always seems to be a group that can’t quite forget it forever, and I decided today that even though I can hardly be called a Haskell devotee (I’ve not fired up Hugs for about six months, now) it still has an effect on how I approach coding problems. In fact, as I trawled through my To Do list today trying to decide what to use my luxurious three hours of freedom on, I realised that I consider any programming project larger than 1000 lines to be unnecessarily big.

Now, that sounds a little silly, because clearly there are a lot of programs larger than this, and I’m using about four of them just to write you this blog post. But they’re all conglomerates - kiloPrograms, if you will - stacked together from lots of little programs that all could be written in less than eight hundred semicolons. I really like that idea, because it means that when I sit down to try and write something I can see the end, as well as how what I do will be useful to me the next day.

The Haskell philosophy - or at least one of them, it’s like a Buddhist conference on the fifth floor of DoC - is that every program can be halved in size. Tristan’s right - if the code isn’t a line long, it can be rewritten! And I love that. It makes me smile.

Posts with the ‘Photos’ tag are photos I’ve taken myself. Others are sourced from elsewhere, and I try to credit them where I can. Cheers.

Tags:

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment