12 12 12

Here we go again… Today is December 12, 2012 in the Gregorian calendar, and people are waxing poetic about how symmetrical, how repetitive and how unique this date is. (Even people who really should know better.) Some people are even getting married today. I wish them the best of luck.

But let me put my science hat on for a moment, and offer the following statement:

The symmetry / reflexivity / repetitiveness / uniqueness of a date expression such as 12/12/12, 11/11/11 etc. ad nauseam, is not axiomatic. It is an artefact of the presentation layer.

In layman’s terms:

It’s not really like that, it’s just written that way.

Continue reading

The Magic of Replaceable Parameters

Apart from hard-coding “Hello, world!”, another bad habit you may have picked up when you learned programming is constructing user-visible messages from parts: strings, numbers and other data, concatenated together.

For example, say that you had to show the user how many unread messages there are in a given mailbox. Let’s assume that mailboxName contains the name of the mailbox, and messageCount holds the number of unread messages. In Java, you might be tempted to whip up a user-visible message like this:

String message = "There are " + messageCount + " unread messages in mailbox '" + mailboxName + "'";

This is not the way to do it in an international application. Let’s find out why, and have a look at a better and much more future-proof way of doing it.
Continue reading

Introduction to Programming, Revisited

Many introductory programming courses start with a very simple first program, the traditional “hello world”. It is intended to teach how to edit, compile and run a program in a new programming environment using a simplified context, and it serves its purpose quite well. Unfortunately, the simple practice used in storing and displaying the text is quite contrary to a basic principle of software internationalization. Continue reading