@ayende You ought to try Mercurial. in reply to ayende 1 week ago

2007

08
Nov

Can we live without Wikipedia?

It’s now about two months since I decided to quit editing Wikipedia, and I think it’s been the best decision I’ve made so far this year. Wikipedia can be pretty distracting if you take it too seriously, and in fact the best advice I can give to anyone thinking of becoming a regular Wikipedian is: don’t.

I’ve decided that I’m not going to make any anonymous edits either. When I see stuff on Wikipedia that is blatantly biased, untrue and even downright stupid, it takes a lot of restraint to avoid clicking the "Edit" button, but I’ve decided that the best thing to do is just resign myself to the fact that Wikipedia is a soapbox, it is a social networking site, it is an indiscriminate collection of information, and it is pretty much everything else that it claims it isn’t, and trying to keep it right is like painting the Forth Bridge.

For a while I’ve been wondering on and off whether I could just dispense with Wikipedia altogether. As an experiment, I’ve added an entry for en.wikipedia.org to my hosts file on my work computer to block it off completely. It gets a little bit frustrating when I come across a link on someone’s blog to a Wikipedia entry on something I don’t properly understand, but hey, there’s always Google to help me seek out more reliable sources. It’ll be interesting to see how long I can go without it, but I rather suspect that before too long I won’t even notice it.

22
Oct

How long does it take to unsubscribe from an e-newsletter?

I clicked the “unsubscribe” link at the bottom of an e-newsletter from the kind of company that I tend to think of as being fairly reputable.

Admittedly, it was one of those companies that require you to register on their website before downloading their software, and demand all sorts of intrusive and unnecessary information such as what you had for breakfast and which football team you support. Don’t you just hate it when they do that?

The message said, “Thank you for unsubscribing. We will process your request within five working days.”

Five working days?!!

Excuse me, but it so happens that back in the dim and distant past I actually wrote an in-house e-newsletter program, and I know for a fact that it does not take five working days to unsubscribe someone’s e-mail address. In fact if it takes anywhere near five seconds, your architecture is completely wonky.

That part of the application is so easy to write that the kids that sell burgers at McDonald’s could do it. It’s a single SQL DELETE statement, that’s all.

This wasn’t the first time I’d unsubscribed from this particular newsletter either. Nor are they the only company that does something like this — another one said that it would take ten working days.

Sometimes I wonder if they do things like that so that your “unsubscribed” e-mail address can accidentallyonpurpose “slip through the cracks” when they consolidate their mailing lists with addresses from other departments or companies.

I thought there were laws against this kind of thing.

Is it any wonder that young people these days are eschewing e-mail in favour of IM and Facebook, when even reputable companies are acting in ways more befitting of spammers?

12
Oct

Is your rudeness necessary?

Although it would probably be a bit of an over-reaction, it is tempting in the light of David Heinemeier Hansson’s latest outburst on his blog to be completely put off the idea of Ruby on Rails for life. I won’t link to it because it is Not Safe For Work, but it has provoked quite a reaction in the blogosphere.

It is beyond me why anyone- should see the need to pepper their conversations and presentations with crude four letter epithets. They either make you seem arrogant and opinionated, or else they convey an attempt to bully people into agreeing with you. This is called “intimidation”, and it is not very nice. It is treating your audience with total disrespect.

Besides this, they completely rob your arguments of any authority and merit that they may otherwise have, and make you look like a badly behaved twelve year old. Truly eloquent communicators can convey the whole range of human emotions — even including the extremes — without resorting to juvenile asbo magnet language.

If you want to pockmark your opinions with expletives, that is entirely up to you. I am not going to curl up and wilt just because you do so. However, don’t be surprised if I roll my eyes and view you as a moron with nothing whatsoever of value to say for yourself if you do.

11
Oct

On ties

I didn’t often have to wear a tie when I was working at Kingdom Faith.

The main exception was when we went out on ministry trips. Especially overseas. It’s funny how the hotter the country you are visiting, and the less reliable the air conditioning, the more insistent they are that you wear a suit and tie.

In Africa, for instance, especially in churches which meet in makeshift tin roofed buildings, immaculate suits are de rigeur. In Malaysia, on the other hand, you can sometimes get away with substituting the jacket and tie with a batik shirt, which is generally considered fairly formal wear in that neck of the woods. However, the air con generally works in Malaysia — often so efficiently that a jacket and tie are the preferable alternative.

Once we got back home again and I was safely ensconced behind the computer, generally the sartorial requirements eased off. For a few years, pastors had to wear ties on a day to day basis, but that rule fell by the wayside a few years back, and besides, I was never made a pastor, so the amount of tie-wearing that I had to do was never too onerous.

This was a Good Thing. I am, of course, a software developer, or, as my last boss at KF repeatedly insisted on calling me, “a geek.” And one of the key features of being a geek is a very strong preference for comfortable clothes — and a pathological aversion to ties.

Some developers will not even accept employment at companies that require them to wear ties. However, much as I can’t stand the things, I am prepared to take a more pragmatic approach.

When I started at my present job nearly two years ago, the dress code mandated a tie. It had done ever since the company was founded. I didn’t complain at the time — it was a new phase in my life, and it conveyed a sense of professionalism, so I decided to set aside my geek sensibilities and go with the flow.

However, fortunately, things move on, and nowadays the corporate dress code is somewhat more relaxed, mainly because in the Web 2.0 industry, ties are distinctly in the minority. Nowadays we only tend to wear them when meeting clients.

I think the general geek aversion to ties stems from the fact that apart from making you uncomfortable and restricting the flow of blood to your brain, they serve no apparent purpose whatsoever. Yeah, I know there’s the whole thing about non-verbal communication and looking professional and reliable and businesslike, but I wonder if somehow, with a bit of creativity, fashion designers could come up with alternatives that convey exactly the same message in a much more comfortable way?

09
Oct

Farewell to the Kinesis

I’ve decided to call it a day with my Kinesis keyboard.

This hasn’t been an easy decision. The Kinesis Advantage is a very nice piece of hardware, and I actually quite like it. Once you get used to it, it is very comfortable to type with, though you need to use Dvorak or Colemak to make the most of it. However, there is one very important thing that I have never been able to get used to on it: programming.

I’ve tried it with qwerty, and with Dvorak, and more recently in the past couple of weeks with Colemak, but these haven’t made any difference. The fact remains that there are some keys which are rarely used in normal typing that are used very frequently in writing code. Keys such as the square and curly brackets, the backslash, plus, minus and equals, and the cursor keys. These are frustratingly awkwardly placed on the Kinesis, and I have never managed to get used to them.

Yes, I know that the keyboard is reprogrammable, but you would have to reprogram something else in their places, and that something else would just be as awkward.

A while ago, someone left a comment on my blog assuring me that I would get used to it and I just needed to bear with it. Well, I’ve now had it for eighteen months and I still haven’t got used to it. There comes a point when you just have to face the fact that something isn’t going anywhere and you need to throw in the towel.

Since programming is what earns me my daily bread, I just can’t carry on regardless.

I’m going back to the Microsoft Natural line of keyboards, which are a tried and trusted solution that I’ve always found very satisfactory. I’ve ordered myself a new Microsoft Natural Ergonomic 4000 keyboard, and I am expecting delivery on Wednesday. I first saw one earlier this year on a visit to a client and I was fairly impressed with it. The key beds are curved slightly to make it more ergonomic, though the effect is much more subtle than the Kinesis. And while the £30 price tag may sound a tad extravagant given that keyboards come pretty much free with computers these days anyway, it is a lot more reasonable than the £225 you spend on a Kinesis. Besides, I don’t like flat keyboards that don’t give you the separation between the hands.

I’m not sure whether I will settle for one of the alternative layouts in the end. I found them almost essential on the Kinesis, on which qwerty is particularly cumbersome, but on more conventional keyboards the difference seems much smaller to me, and probably not worth the effort involved in switching. I never managed to match my qwerty typing speed on Dvorak, and now that I’ve switched back over the past few days I’ve realised that I can manage quite a good rate on qwerty, though I haven’t actually measured it properly. There is also the Remote Desktop Problem — when you have to use other computers, alternative layouts tend to get in the way somewhat. Besides, I’ve expended far too much time and energy on this whole kettle of fish and I am rather disinclined to experiment any further now.

04
Oct

Is there a future for Rails?

It seems that interest in Ruby on Rails has plateaued somewhat in recent months. A year ago there was quite a buzz surrounding it, particularly among .NET developers, for whom it has been a rather popular sideline. However, I can’t help getting the impression that the buzz has subsided somewhat recently. Rails may take a lot of pain out of web development, but it has not taken the world by storm.

Why should this be? I think there are several reasons.

First, the business case for Rails always seemed somewhat limited to me. Developers love Rails, but managers tend to be less convinced. The enterprise world is entrenched in Java and .NET, and shows little incentive to change other than a gradual drift from the former to the latter. Successful open source web apps are mostly written in PHP; it seems that several of the most promising looking open source Rails applications, for example Mephisto and Collaboa, are to all intents and purposes dead. The area where Rails seems to be enjoying the most success is in the heady bubble of Web 2.0 startups and venture capitalists, but even then it still has to compete with .NET, PHP and Python.

The second reason is that some copycat MVC frameworks in other languages, such as Cake for PHP and Castle Monorail for .NET, have come on the scene in recent months, stealing a lot of Rails’s thunder. These play much better with people’s existing skills and save a lot of time that it would take to learn a new programming language. They also fit more convincingly into the world of web hosting, which is deeply entrenched in PHP and .NET. And therein lies the third problem: not many web hosts offer Rails as an option, especially on entry level packages, and this tends to be something of a hindrance to the success of open source applications.

Despite all this, I still think it is a good idea to learn Rails, as it will help you to become a better developer. Ruby is a nice language which does very well in terms of elegance, simplicity and extensibility, and Rails teaches you good programming practices from the word go, as well as giving you a solid understanding of the concepts of O/R mapping, active records, the Model-View-Controller pattern and test driven development. And although the market for Rails may not be all that impressive, it is by no means non-existent. It is just that supply is somewhat higher in relation to demand than, say, Sharepoint.

So yes it is worth learning, but I don’t think it is something to spend too much time on. Rails can make a good compliment to your .NET skills, but I don’t think it should replace them.

04
Oct

The future of my blog

I’ve been thinking a bit more about my blog and what to do with it.

Content wise, it seems to have pretty much settled down into a topical blog, concentrating largely on software development and the surrounding culture. I sometimes wonder if it’s become a bit too impersonal lately though — perhaps some more non-work-related posts are in order.

I’d like to get a regular rhythm up and running too. Scott Hanselman wrote recently about your blog’s "heartbeat" — how often you post in particular. Mine has been somewhat variable in the past, between one and nine posts a month, though I like to try and post at least once a week if I can. This month I’ve decided to try something new, so I’ve written a bunch of posts ahead of time and set them to go live automatically every Monday and Thursday. Anything on top of that is a bonus. Perhaps I should have done that at the start of September, when first I was off on holiday in Scotland and then when we came back we had a church media fast. Some people write twenty or more blog entries a month — personally it beats me how on earth they find the time to do so, and contribute to various open source projects, and get any work done, and have any kind of a social life to speak of.

As far as technology is concerned, I’ve decided to stick with WordPress for the foreseeable future. Architecturally it may be completely wonky, and you may need to keep a constant eye out for security updates, but in terms of features it is the best blogging software available and pretty much a de facto standard, and there is little reason to switch to anything else.

01
Oct

Church 2.0

Our church is organising a communication and media master class on 19-20 October with Mal Fletcher. This is highly recommended for anyone who is interested in using media in a Christian context. Mal Fletcher is one of those guys who is pretty hip with using modern technology and Web 2.0 and so on to communicate. I gather that the last time he was here, he was getting everyone excited about blogging, podcasting and the like. Unfortunately I missed that particular meeting so I don’t know exactly what he said, but the feedback sounded pretty good. His websites, nextwaveonline.com and edges.tv, have a lot of interesting and effective articles, videos and documentaries on various social issues that affect us all these days.

I often think it would be particularly good to see churches making much more effective use of blogging in particular to communicate their message. Blogging has a much more personal, authentic feel to it than traditional websites, especially if comments are enabled so that visitors can feel part of the discussion. For some reason, blogs don’t seem to have a particularly high profile on most major ministries’ websites though.

(For anyone wanting to get into blogging in a Christian context, The Blogging Church by Brian Bailey and Terry Storch is a must-read.)

26
Sep

Is your code held together with bits of string?

Meh.

I hate naive code that sends data to a database by concatenating it into a SQL string.

Unfortunately, there is far too much of it knocking around — no doubt because of the proliferation of rubbishy tutorials that teach beginners that that is the way to do database access.

Take this C# example:

public int InsertEvent(DateTime date, string description)
{
    using (SqlConnection cn = new SqlConnection(connectionString)) {
        cn.Open();
        SqlCommand cmd = new SqlCommand(cn,
            "insert into Events (Date, Description) values "" +
            date.ToString() + "", "" +
            description + "";select @@IDENTITY");
        return (int)cmd.ExecuteScalar();
    }
}

It’s not just the SQL injection vulnerability that makes this code stink like a sewer: it has localisation problems as well.

Here in the UK we write dates as day/month/year, so today would be 26/09/2007. However, on the other side of the pond, they write dates as month/day/year, so today would be 09/26/2007. So if the locale of your ASP.NET application is different from the locale of your database login, you will get either the wrong date or a data conversion error.

On your development computer and your production server you will probably have your locales set up so that it all works correctly. However, it causes problems when you have to set up the application on a new box — for instance, when another developer starts to work on the project. Especially if the other developer is in another country.

Please stop doing this!!!!

Any decent, modern programming language will let you use parametrised queries to keep your SQL and data separate. These also allow you to send dates and times to the database in native, unambiguous datetime format, avoiding any thorny localisation issues, and they all but eliminate SQL injection vulnerabilities.

The only excuse for using string concatenation in this way is that you still have to support PHP 4 which does not give you the option of parametrised SQL queries for MySQL. Even then, if at all possible, you should be upgrading to PHP 5, which does.

20
Sep

Where has all the disk space gone?

My computer had slowed down to a crawl. Since it was a while since I last defragmented the hard disk, I decided to give that a try — only to find that my primary partition (of 48 gigabytes) was almost completely full.

When you are confronted with something like this, you need some kind of utility that will give you a graphical report of all the directories on your hard drive, so you can quickly drill down and see where it has all gone.

A quick Google search led me to JDiskReport. It is a Java application that scans your entire hard disk and produces a report that you can easily drill down to find the culprit. There are some commercial (shareware) programs knocking around that do much the same thing, but this one is free, which is pretty nice.

jDiskReport1

You can easily drill down through your directories — it lists the biggest ones first — and zoom in on anything particularly horrendous. In my case, the worst offenders appeared to be Google Desktop Search, two gigabytes of photos that I no longer need, and stacks of backup files and things. In the end I managed to clear out about seven gigabytes of disk space. Perhaps I should clear out more — my user profile would be better off on the much larger D: drive for instance with the rest of the data files. I like to keep as much free space on my primary partition as possible to avoid hurting performance.

Unfortunately it seems a bit sluggish on Windows — it took nearly twelve minutes to scan all 48 gigabytes of my primary partition. I suspect this is probably more to do with Windows than the application itself though. There is a similar feature built in to Ubuntu and it is pretty responsive by comparison. Then again, I have always found Windows a bit slow with some file operations (especially moving and deleting) compared to their Linux equivalents.