Standard measures are internationally approved amounts and counts to help countries inter-operate. Yet for programmers they pose massive challenges.
This article looks at some of the most common measures and how they pose challenges when internationally used.
Based on over a decade of writing systems for international use here are some of the primary challenges I’ve encountered and how I set about addressing them.
- Weight and Distance
- Wrap up
[read more=”Read more” less=”Read less”]
Date time format
The single most common of the standard measures are dates and times, yet how systems manage the formats is very varied.
Microsoft Excel is a very easy way for people to see just how varied dates and times are.
Using y for years, m for months, d for days, h for hours, n for minutes and s for seconds, here are some variations.
dd/mm/yyyy is European whilst mm/dd/yyyy is American. So if you get 01/02/2018 is that the first of February or the second of January?
Quite often the only true way of sharing date data is to use Universal Date Time format yyyy-mm-dd hh:mm:ss but not everyone follows that rule.
Midnight on the 1st of January 1970, how many miliseconds have passed since that moment.
So Unix time is just a number and the dates and times are calculated from that.
While long since passed at this stage the Millennium bug was because mainly banking systems stored dates as dd/mm/yy
When the system saw a year of 01/01/00 it might assume there was an issue or not handle it properly.
So the systems were expanded to four digits 01/01/2000.
Not a problem for standard measures our lifetime but what happens when it expands again in 01/01/10000.
We’re not even going to get into the challenge of when PM and AM are used.
Whatever system you elect to use, you need to make sure all the connected systems agree on what format to use.
If you can’t agree on a format you need to write very good translation code to make sure it gets translated forward and backward properly.
Spring forward, fall back
Daylight Savings Time or DST was originally introduced during World War I amongst standard measures to decrease energy use and is still with us today.
If you have a security issue, or are watching security footage from a video camera, Sunday 25th March 2018 is missing an hour…
At the same time Sunday 28th October has two hours the same.
Whilst customers enjoy seeing transactions in local time, banking and back end systems need to be able to compensate for daylight savings times.
Sounds easy until you come to a security audit that knows to double check those times.
The solution is to use an Id marker, not a time stamp, like using Unix time, just a number.
However you do need both as when you go searching the date time stamp is what humans use.
Now when you work internationally not everyone is on the same date or even time.
Some countries have this amongst their standard measures and observe daylight savings time, some countries do not.
Recent discussion see the probability that systems will have to change as DST is abandoned in Europe.
When you combine a central time, which experiences DST or not, you need to make sure your systems match.
When you get stock lists and their associated cost price, retail price and or discount prices when dealing internationally you might have a small challenge when you start.
An Irish amount of €12,345.67. Germany writes this as €12.345,67. Whilst in France they use spaces €12 345,67
Now because not all systems can handle the symbol of the € as it didn’t exist before 1999. Some systems convert it to three letters EUR or USD for US Dollars $.
Dollars differ from the US to Australia so locally they write $, but most systems need to have (US)$ or (AU)$
How you choose to write and handle currencies is often a global standard measures challenge.
Database systems like to store data in either Text or Number format. If its in number format then addition, subtraction, etc. is a lot easier. In text, you need to take the data out, manage it and then perform your math. Be careful!
Text will give you the most accurate but removes all the easy math capabilities. If it’s just a number your system must be careful in its conversions.
The solution is to have multiple data fields resulting in redundant data but you keep both the text and currency and number in different fields which gives you the best of all combinations but does use more data space.
Conversion rates change from minute to minute let alone day to day.
If you buy something in sterling for X but sell it in Euros for Y, how much profit did you make?
The next day the conversion rate dramatically changes due to economic forces.
How can you work out what was or wasn’t profit?
The solution is that when you buy or sell something to also store the conversion rate at that instant for reference.
At any point you can recalculate how much / little profit generated at the instant of the sale.
Weight and Distance
Changing standard measures
OK, there is no global change of weights, if there was there would be global economic chaos.
However a bit of chemistry and physics have kicked in to cause a bit of trouble in the world of “standards” of late.
Over time, chemicals change. This is called a “half life”.
In standard measures the weight to compare against for 1kg is a single bar of platinum in a single ignot called “Le Grand K” in a safe in Paris.
Its weight will change due to its half life so there needs to be something different.
The fluctuation is about 50 parts in a billion, less than the weight of a single eyelash.
But although it is tiny, the change can have important consequences.
“This is not acceptable from a scientific point of view.
So even though Le Grand K is fit for purpose at the moment, it won’t be in 100 years’ time.”
The system will use electromagnets now instead to measure 1kg in weight.
When lat and long aren’t quite right
There is no denying that tools like Google Maps have revolutionised how we perceive and interact with maps.
Yet positioning can go wrong.
When you build systems around geolocation, people find ways of cheating the system.
Pokemon Go from Niantec uses geolocation as a core element of the game. They can’t stop the cheating but if they catch you, they ban you!
This adds new meaning to their marketing tag line of “gotta catch ’em all”.
Where you have proprietary measurements and approaches you can’t call them standard measures, yet they become defacto approaches.
Google maps deliberately also presents some wrong coordinates for security reasons
Criminal minded people may use the technology to carry out unwarranted and uncalled-for activities such as terror attacks, exploitation of military assets, target killing, trailing a potential victim, kidnapping, demanding ransom money, and compromising national security etc.
Numbers of such activities may be carried out using the guidance from “Google Maps” without getting noticed. This is largely due to that anonymous login is allowed into Google Maps.
Getting the units right
When it comes to weight and also volume the unit of standard measurements is important.
In Europe we predominantly use Metric (meters, liters and grams) and in the US predominantly Imperial (feet, gallons and pounds).
Even the brightest people on the planet can sometimes get units wrong.
NASA lost a $125 million Mars orbiter because a Lockheed Martin engineering team used English units of measurement while the agency’s team used the more conventional metric system for a key spacecraft operation, according to a review finding released Thursday.
The units mismatch prevented navigation information from transferring between the Mars Climate Orbiter spacecraft team in at Lockheed Martin in Denver and the flight team at NASA’s Jet Propulsion Laboratory in Pasadena, California.
On 23 July 1983, Air Canada Flight 143 became a glider.
It ran completely out of fuel about halfway through its flight from Montreal to Edmonton.
The ground crews and air crew miscalculated the fuel load. Primarily this was due to the recently adopted metric system.
Is that feet or meters or AUs
Fair enough we have Metric or Imperial but they so aren’t the only games or measures of distance in the game.
This great unit converter puts in perspective the units available.
Meters, miles, yards, feed, inches, leagues, furlongs, chains, rods, links, light-years, parsecs, astronomical units (au), nautical miles, pace, lines and then all the Roman measurements.
In HR terms this topic is incredibly difficult and sensitivity is paramount.
People being people don’t fit well into standard measures as we’re all different.
In order to ensure data accuracy most programmers will put things in closed questions, check boxes, radio buttons or drop down lists.
What you put in the lists can be contentious.
Gender Identity rightly is a growing area of discussion.
Like gender which nationality you identify with can change depending on the geopolitical state of the world at the time of the discussion.
Regardless of your personal opinion, your users will identify with their own beliefs. A person can also become “stateless” which requires its own exceptions.
When designing an interface people with colour blindness may be some of your users as well.
There are many different kinds of colour blindness. The primary consideration is contrast.
Using an algorithm to determine mathematically the best contrast can be found here. Should you use black or white text on top of that colour!
The difference between print and screen
Mixing mediums is always going to be challenging for standard measures.
“It looked different on the screen!” Printing using ink vs. on screen colour causes differences.
One of the biggest reasons is that your screen uses Red, Green and Blue (RGB) picture cells to make the screen work.
A printer uses Cyan, Magenta, Yellow and Black (Key) inks to print with called CMYK. So you have to translate the colours from one system to another.
This area of translation to very rigid set of printed colours uses a system called Pantones or Pantone Matching System.
Screens generate light where paper doesn’t which is also a factor.
In computer terms you have RGB and you also have two other systems to translate to and from.
There is another called Hue, Saturation and Lightness, or Value giving HSL or HSV.
Web colours have defined names which are translated into a Hexidecimal or Hex colour system.
Computer graphics also have transparent or “alpha” to consider. When one image is slightly see through, what effect of mixing colours does that have?
So wherever you say the colour red you might be saying
- RGB, 100, 0, 0 or 255, 0 , 0
- HSV 230,100,100 or 0, 100, 100
- CMYK is 0, 100, 100, 0
- Web and by HTML definition red is #ff0000
Colours are challenging.
Top to bottom, left to right.
Finally there are international translation challenges which is a whole discussion in itself.
But apart from the just the words, some languages are read from right to left.
Take numbers for example, you actually read them right to left.
Some Asian languages are written bottom to top. Your scroller goes which direction?
Standard measures make trade and the world work. Making them work in software is down to the diligence of programmers.
When students learn programming in college, they need to understand “the how of programming” and rightly so.
Yet when you get into the real world, dealing with “the exceptions” is what makes the difference between buggy and intelligent software.
Been there, done that, built the solutions!
When you work with data warehouses and when working out “apples with apples” reporting, units are vital.
I’m sure you have more examples please share them with me so I can add them and help all programmers.
If there’s anything in this article you’d like to chat to me about you can contact me here or on social media.