Blog Posts in "programming"

Simon Willison on vim

Posted at 09:57:44 on Mon, May 12th 2008 by graham
in: programming python quotes simon willison vim

Here:

I’d use these [tips on using Python with vim] if I wasn’t still scarred from the time vim encrypted my file instead of saving it because I had caps lock on by mistake.

Bless.

What's in a mail client?

Posted at 19:13:06 on Wed, September 12th 2007 by graham
in: email mutt neural misfires programming thunderbird usability

Seriously, what makes a great mail client? I've been wondering and I don't think I can come up with an answer with which I'm completely satisfied.

Not too long ago (about a couple of weeks IIRC), I switched from using Thunderbird as my mail client to using Mutt. This is a decision that's raised a few eyebrows amongst my geek friends, though it's also been met with responses like "cool, you're using a proper client, then," with some regularity.

It's considered odd, apparently, to use a command-line client these days, even one as powerful and useable as Mutt (+ postfix and fetchmail) undoubtedly is. Maybe it's because even in Linux circles there's some suspicion of people who choose to use command-line tools when perfectly serviceable GUI ones exist (some people also seem to take it as an offense to nature that I use vim instead of Eclipse+PyDev, or at least gvim, for development work. I'm typing this entry in vim, as it happens, but that's for other reasons that I might cover later on).

I had to think long and hard about making the switch, partly because I was so used to using Thunderbird (or indeed just about any GUI mail client) by that point, and partly because I too felt like going to Mutt would be something of a regression.

I switched away from Thunderbird because it was, for my purposes, too damn slow. Whether that's an issue with my machine or with the client or with the volume of emails I receive I don't know, but whatever the reason I couldn't be doing with having to wait for several seconds every time I wanted to compose a new message. I should just be able to hit ctrl+n and have a new message window at my fingertips.

Another thing that made me switch - and this was one of the big ones, in fact - was the lack of keyboard-only usability in Thunderbird. Maybe this is a programmer thing, but when I use a program I want to be able to get my stuff done without having to take my hand off the keyboard to use the mouse. There are a couple of extensions for Thunderbird (nostalgy and one that makes it gmail-like in terms of keyboard shortcuts), but even so it's not enough (for me, anyway). 

The final thing, and the most important one, is searching. Thunderbird offers pretty good searching but it's mouse-driven (again) and doesn't always allow for the kind of search that I sometimes want to do, or at least not quickly. With Mutt, if I want to search, I use its limit function (by hitting the L key) and then enter, as a set of shortcuts and regular expressions, the search criteria. And, so long as I've not got it wrong, I get the results back that I'm after.

So, I hear you ask, if you like Mutt that much, why are you complaining? Well, probably the most trivial issue, is that Mutt isn't straightforward to configure. Well, it's straightforward, but it's not simple (or perhaps simple but not straightforward). By this I mean that in order to get it doing what I want it to do I have to alter the .muttrc file in my ~. To get procmail to filter things the way I want I need to create a .procmailrc and to get fetchmail to fetch my mail I need to create a .fetchmailrc (though Mutt does support POP and IMAP natively I choose to use Fetchmail and Procmail to do filtering. Also, there's a pretty decent config utility for fetchmail called fetchmailconf). I need to learn the configure options, tweak them, make them do what I want. Of course, that's just the way these things work and I'm very happy with Mutt for doing what I want it to do; it's just taken rather longer than I would have liked to get it to this stage. It would be nice, from a user perspective, to be able to user something like fetchmail conf not just for fetchmail bug also for procmail and Mutt. Of course, this being the lazyweb, someone is going to read this and tell me that such tools exist, I'm sure.

Once again I'm left with an idea for a project. Or rather two projects. Well, two possibly mutually exclusive projects (from the point of view of a one-man show):

  1. Create a tool that does mutt / fetchmail / procmail configuration simply (for a given value of simply), so that people don't have to learn quite so much to be able to use Mutt (though learning a lot isn't a bad thing; I'm talking about increasing productivity here).
  2. Create a mail client that is simpler to configure than, but still contains the power of, Mutt. To make it more accessible to people, it would probably have to be a GUI app, or at least offer a GUI option.

Actually, what I really think we need is an app that does for desktop mail clients what GMail did for webmail clients. Make email something that you don't have to think about; you just read it, respond to it (if necessary) then archive it (or delete it). Build into that something akin to Mutt's search capabilities, integration with OpenPGP for encryption and signing and perhaps you'd be getting close to my ideal desktop mail client.

As long as I could have my keyboard navigation, of course. 

Whistle while you...

Posted at 19:42:00 on Thu, December 28th 2006 by graham
in: novel programming thoughts writing

The Glue

Posted at 14:05:00 on Sat, September 23rd 2006 by graham
in: computing editing programming writing

Zokutou word meterZokutou word meterZokutou word meterZokutou word meterZokutou word meter
15 / 333 (4.5%)
Someone has poured glue into my head. Whoever they are, I wish they hadn't, but it's here to stay for a while and it does not, let me tell you, make life any easier. Editing is out for the time being. I managed to get through two pages of Muse before the glue stopped me; trying to work out a way around the fact that whoever built Gloucester Road and Embankment tube stations rather inconsiderately did it in such a way as to make them nothing like they are in my head was apparently too much for my epoxy-filled brain, and it gave up, giving me a splitting headache, which would only go away if I lay down whilst agreeing its terms of surrender. So, editing not being an option - and the fact that I haven't had the time to do any this week because of the pressures of work is not making me happier about this - I've decided to do some programming instead, which I find rather easier. Getting a computer to do what you want is, in the end, fairly straightforward. All you have to do is get the right instructions in the right order. It's certainly a damn sight easier than trying to make Gloucester Road tube station be the venue you want it to be when it quite clearly isn't anything of the sort. Damn London Underground architects.

Objects: simplicity itself

Posted at 21:38:00 on Fri, May 05th 2006 by graham
in: programming

Another techy post, I'm afraid. I'll get back to the writing / ranting / mumbling ones in a bit. Promise.

A nicely productive and generally un-frustrating day as far as Das Projekt is concerned, though if Eclipse crashes one more time when I try to update it I might just start getting a mite ornery.

Managed to get a couple of niggling bugs nailed down this morning, including an annoying database issue that turned out to be caused by two libraries using two different database APIs but the same basic SQL statements, with the upshot being that one knew what to do with the SQL whilst the other just shrugged its shoulders and washed its hands of the matter. The trouble was that the second library was only being called on a sporadic basis, making the bug that much harder to track down.

Now that I've got the big things done, at least in outline (for example, one of the Big Things is a scheduler that sends out SMSes on, er, schedule. It doesn't actually do that yet, it just pretends to, but it's just a case of uncommenting a line of code and we're away) I can just go through the list of required features, code them and then tick them off. Hopefully that won't take too long.

One of the happy consequences of my doing this work is that I've produced a lot of very re-usable code. Part of the spec for Das Projekt was that its original creators had meant for it to become an all-purpose platform that could be sold to all and sundry. Unfortunately, due to time restrictions that hasn't happened, but I've tried to write my code in a way that will make it very flexible when they do come to produce something that they can sell.

It's one of those situations where my own code has surprised me. Things have just worked, which, though not a novel experience for me (he boasts), is still a pretty gratifying one. What I mean by that is that I've written a number of small frameworks that allow new additions to the system to be added in a few lines of PHP. You want to handle a new incoming text message? Write a quick handler and drop it into the MOHandlers directory. All handlers descend from a common hierarchy and have database access where needed. Need different database access? Don't want to write the SQL to do it? No problem: we have table gateways and OR mappings to take care of it all for you.

So a lot of what I've been doing today has consisted of writing a couple of lines of code, dropping it into place and then sitting back and saying "Oh. It worked. Shiny." a lot. Which is why this post by Andy Skelton about his experiences writing the WordPress widgets hierarchy (which sadly never got used) struck a chord with me when I read it.

Objects are cool, and that's all there is to it.

Search

Latest Twitter

One of them days: unexpected happenstance, hard work, confusion and phone calls. Throw in some photography and it'll be a good one. 2008-07-24 16:58:22 (More)

Recent entries

Launchpad Bugs

Post Categories

10mm 15th of july upload amusing animals atheism autoportrait bass bbc bird blackandwhite blogging blogs buildings canonical caton church colourised computing cricket d40x desaturated django editing flickr flower forestofbowland from the inbox funny general heysham home humour in the news lancashire lancaster landscape links linux london lune may 12th upload me monochrome morecambe morecambebay music nanowrimo nature news new site night norfolk norfolkbroads novel novel-the-second observations pendle people photography podcasts posts that started out differently programming python quotes ranting reading reflection religion science sea selfportrait sepia shadows sigma1020mm silliness sky stupidity sunset texture thoughts three hundred and sixty-odd days of 2008 travel tree twitter ubuntu warren ellis, internet jesus water work writing writing ideas

About

Graham Binns is a writer and software developer from Lancaster, England, with rather too much hair. He has been making things up for as long as he can remember and has been making code work for long enough to make a living from it.

He has written one novel, which is in the process of composting, and is working on a second.

From the gallery

Slightly creepy Notices There's a lot of this in Norfolk tags: norfolk sign country n95 Peace What whispers did these walls one hear?