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.Read more →
It all started with an idea, something to scratch a personal itch. I was learning elementary French, and realized that there is an algorithmic approach to generating the numbers. Not a very elegant algorithm, but one that could easily be turned into a computer program.
The idea turned into a function, and soon enough it turned into an iPhone app, now called Les Nombres and available from the App Store (and also for Windows Phone). My function takes a nonnegative integer and turns it into a French language string, which is displayed on the screen. It could be fed into a speech synthesizer, but in Les Nombres the numbers are recordings of a native French speaker, which I think is nice. (And I couldn’t use recordings of Apple’s “Virginie” voice from OS X anyway due to its license.)
To keep things simple, Les Nombres only deals with the numbers 0 to 100, even though my function could do up to 1,000 out of the box. It involves some 90 lines of Objective-C code, including two recursive calls. It was fun to write, and I learned something in the process, but ultimately I didn’t have to write it at all.Read more →
If this blog entry was written 10–15 years ago, the title would have been “Unicode is in Your Future“. Luckily, the Unicode standard has been widely adopted during the last decade, so much so that it has almost become a part of the process and not something that you need to expend very much extra effort on. It is here Now, and has been for some time now.
However, Unicode still isn’t quite as widely understood as it needs to be, and it is often adopted as a black box that nobody can really fix when something goes wrong. Therefore it is not at all bad to try and bring it into perspective.
You need to understand at least why Unicode should be used, and how not to make it more complicated than it is (even though it can still be quite complicated). So keep reading.Read more →
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.Read more →