Tag Archives: about

On the Topic of bad error messages

Yesterday, I was on my way home and had just missed my bus. No Problem, I thought, that’s the reason I have an account at StadtRad Hamburg (an automated bike rental service we have in Hamburg). So, I made my way over to the next station while pulling out my phone to unlock a bike.

Now, there are two ways to unlock a bike (more, actually, but I only had access to two). One is via the StadtRad App, and one is via calling a special telephone number written on the bike. So, I started up the App, entered the number of the bike and pressed “rent”. And…

Englisch: "An Error has occured"
Englisch: “An Error has occured”

Oh well, it happens to the best of us, right? So, let’s retry this.

Hmm, still the same error. Interesting. Well, it’s not the first time the app screwed up (the last time I rented a Bike, the servers went down and did not register me returning the bike, leading to me being billed for three days for a bike I could not even ride because it was broken. Needless to say, I got my money back, but since that evening, I no longer trust their servers). So, I called the phone numer to unlock the Bike.

So, the Telephone system is fully automated and supposed to recognize your phone number if it is registered to your account, which mine was. So you can imagine my surprise when the friendly computer  told me that my phone number was not registered to any account and that I would be forwarded to a human for support (Poor bastard, having to work at midnight).

After verifying my account information, the friendly support rep informed me that my account had been locked because the credit card they had on file was about to expire and they (understandably) did not want to be left without a way to get the fees they are owed. This is not the problem. I don’t even have a problem with the fact that this left me having to wait 20 minutes for the next bus (a timeframe which would have been enough to ride the bike home).

My Problem is the way I found this out. I mean, seriously. “An Error has occured” in the app? Could you be any less specific? And then my phone number was “not connected to any account”? If my payment details are wrong, for gods sake TELL ME, and don’t give me unspecific or just plain wrong error messages. Writing good error messages is one of the most important things you have to do concerning usability. It’s not hard, people. So much bullshit could be avoided if a few programmers could have been arsed to implement a special case for this error (especially since this is a show stopper for the end user, and something he should be concerned about, instead of thinking “well, seems like they screwed up their servers again. I’ll just try again tomorrow”).

Please, PLEASE write decent error messages.

That is all.

On doing things right the first time


– Jeffrey J. Mayer

If there is one lesson I have learned at my current job, it is that you should always, always, take the time to do things right the first time, especially if everything else you do will be built upon it.

For example, about a year ago, I was tasked with migrating an aging access database to MySQL. The Database was horrible. There were just about no checks in place to prevent inconsistent records (Changing an ID in one place would not update other references to that ID in the remaining parts of the database), a bunch of very inefficient data types and needlessly complicated ways to store values (For example, instead of using a boolean value to indicate if a course was offered at a specific university, the column would either contain NULL (or the access equivalent) or the name of the university.

Now, someone had already imported the database layout into MySQL, so I took a look at it. I wrote down several ideas on how to improve the database, including the usage of “Foreign Keys” to preserve consistency, boolean variables to store true/false-Values, the use of IDs instead of names as primary keys, and so on. Once that was finished, I talked those proposals through with my employer and we discussed the changes. Most were accepted, some were scrapped, including the foreign keys for some reasons I cannot remember (but which seemed somewhat logical at that time).

The database has been in use for a while now, and it has come the time to add some functionality (triggers to automate boring tasks and new ways to display the data, for example). So, for the first time in about 6 months, I took another look at the database, and at the data it contained.

My initial reaction:

Some bad decision on my part, combined with bad decisions when creating the frontend, combined with the fact that the database was accessed through three different interfaces, and only one of them having any form of sanity checks, the database had deteriorated into a state which made it nigh impossible to do anything without at least three different ways of abusing MySQL in ways that would have made my databases instructor weep.

The problem? The database is in use. I cannot change it, at least not within a reasonable timeframe, and without rebuilding most of the frontend (which was created with a piece of software called “PHP Generator for MySQL”, which has some nice features but also frequently throws a hissing fit if you do not use it in exactly the way it thinks it should be used, not to mention generating code that is vulnerable to the most basic of XSS (which has been reported by me for more than 9 months, by the way)). That would be an effort of at least 20 hours, which could have been avoided by one or two hours of work improving the database structure in the beginning of the project. And I don’t have those 20 hours.

My contract with my employer will end soon, and once me and my supervisor are gone, they will have no one left who can even understand MySQL. I pity the person who will inherit this database and try to make sense of it. I am trying to document things as good as I can, but there is only so much you can do for a database that should have never existed or been put out of its misery a long time ago.

Seriously. Do things right the first time, or you will regret it in the long run.