Links like this…

When I first started using Vim, I watched a fascinating talk given by the author, Bram Moolenaar, titled “7 Habits For Effective Text Editing 2.0” (click the link to see the presentation. It’s 80 minutes long so maybe grab a coffee first ;-) ). One of the ideas he talks about, and something which seems to be a pervasive philosophy of Vim, is the “Three basic steps”:

1. Detect inefficiency
2. Find a quicker way
3. Make it a habit

I think this is an excellent philosophy for computing in general – why do something repetitive yourself, when the computer can do it much more quickly and accurately? An obvious (and trivial) example is “search & replace”, which saves you from having to scroll through a file to find all the occurences of a string, then manually type in its replacement.

Since watching that talk, and as I got more familiar with Vim, I started “detecting” such inefficiencies everywhere; often in apps which are not nearly as flexible, which usually makes these inefficiencies more frustrating because they are harder to solve. I had one of these moments while browsing stackoverflow today.

Stackoverflow is a great resource, with lots of good information, however there is so much discussion that you could never read it all. That’s why every now and then I like to browse the Hottest Questions This Week, which does a pretty good job of distilling out the good stuff.

Now, I like to browse all those articles in full because it’s difficult to tell from the question whether or not it’s going to have one of those “gem” answers. So I started middle clicking all the links down the page to open them in new tabs as I normally do, when I suddenly realised how inefficient I was being. If only there was some kind of macro that could open all these links for me…

Well as it turns out, there’s an extension for that! It’s called Links Like This and does exactly what it sounds like it should. Just right click on a link, select “Open Links Like This…”, and all the similar links on the page are highlighted, with the option to open them all presented in a very slick interface. I’m not sure what heuristics it uses to determine which links are alike, but it does exactly what I want it to do: open all the “Hottest Questions This Week” in new tabs, saving me a full minute of my life and 48 mouse clicks. It even differentiates between visited links and unvisited links, so if I view the page twice in one week, it can open only those links that I haven’t visited! Awesome :D .

This illustrates to me a couple of things. Firstly, for repetitive computing tasks there is always an easier way. I wonder where else am I doing something manually which is more suited to some clever code?
And secondly, this is the power of open source software. Firefox’s value lies in it’s openness and the ease of writing extensions. There is no other browser which can compete with firefox’s features, because whenever someone sees an inefficiency or wants to add a feature, mozilla has made it simple for them to code a solution and share it with the world. I doubt very much that any other browser (especially a proprietary one like IE or Opera) would add support for a feature like this.

That’s also why I think KDE’s plasma is so important and exciting: it’s doing for the desktop just what firefox is doing for the web. Plasma widgets are really just “extensions” for your desktop, and you can code them in Javascript (just like a firefox extension), as well as Python, C, C++ and Ruby. Anyway, enough of a braindump. Back to work.