How not to sort a list of countries


Being from the United Kingdom is hard sometimes. When scrolling through a list of countries, we might be found down the bottom as "UK" or near the top as "Great Britain". Occasionally someone files us under "England" - thus ignoring Wales, Scotland, NI etc. Once in a while, it'll be "The UK". Truly, no one has suffered as we have suffered⸮

Here's a list of countries from the Curve Credit card (join and we both get a fiver!) - I scrolled all the way to the bottom looking for the UK, only to find it nestled between France and Greece!

A list of flags. Estonia, Spain, Finland, France, UK, Greece, Croatia, Hungary, Ireland.

The more you look at the list, the weirder it becomes. Why is Spain next to Estonia? Ah! Because they are Espania! Croatia next to Hungary? A sensible location for the Republika Hrvatska!

I assume they've been sorted by each country's ISO 3166-1 alpha-2 code:

  • EE
  • ES
  • FI
  • FR
  • GB (Because UK might be confused with Ukraine, I guess?)
  • GR
  • HR
  • HU
  • IE

I know there are loads of falsehoods that programmers believe about names, flags, languages, countries, and addresses. So I guess we need to add a "falsehoods programmers believe about sorting lists of countries"!


Share this post on…

  • Mastodon
  • Facebook
  • LinkedIn
  • BlueSky
  • Threads
  • Reddit
  • HackerNews
  • Lobsters
  • WhatsApp
  • Telegram

5 thoughts on “How not to sort a list of countries”

  1. said on twitter.com:

    the UK's ISO 3166 alpha-2 is technically GB (because when thinking up codes they generally took out words like "republic" or "kingdom")

    "UK" is actually just exceptionally reserved upon the request of the UK but isn't technically assigned to the United Kingdom

    Reply | Reply to original comment on twitter.com
  2. says:

    Same with Germany/DE=Deutschland – in country lists you can either find it near Denmark or near Ghana, independent of the currently used translation…

    Reply

What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.

Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <p> <pre> <br> <img src="" alt="" title="" srcset="">