The Many Lives of Null Island
99 points
by sebg
1 month ago
| 4 comments
| stamen.com
| HN
ryandrake
1 month ago
[-]
I've worked in mapping software and GPS in some capacity for 20 or so years, and Null Island is always my go-to example of why it's bad to use an actual valid value for a variable as a default-initializer, as a sentinel value, or as a signal for "invalid". 0,0 is a real location and should not mean anything special besides "that exact location in the Atlantic" to your code. There are an infinite number of actually invalid lat/lon pairs, if you really, really need some constant that gets interpreted as "an invalid lat/lon". 0,0 is not one of them.

I always joke that if nuclear war ever broke out, that spot in the Atlantic is going to bear the brunt of the explosions from all of the poorly-coded computer systems firing the missiles.

reply
vitus
1 month ago
[-]
That's not as bad as MaxMind deciding that US IP addresses should default to geolocating to the middle of some Kansas farm, in the absence of more data. (38°N 97°W)

Original article: https://web.archive.org/web/20160410172437/http://fusion.net...

(I see others have also linked to other related posts)

reply
trailbits
1 month ago
[-]
Even non-physical numbers are problematic to signal 'invalid'. I had a customer use -999 as a placeholder for 'invalid' data. Years later somebody made a higher level data product that averaged and combined that data with other products, without knowing to first remove those 'invalid' values. The resulting values were all now within physical limits, but very very wrong. The best solution is to use IEEE NaN https://en.wikipedia.org/wiki/NaN so that your code blows up if you don't explicitly check for it.
reply
gizmo686
1 month ago
[-]
NaN is a sentinel value, just as much as 2,147,483,647 is

The only difference is that NaN is implemented in hardware. However, taking advantage of that requires using the hardware arithmetic that recognizes NaN, which restricts you to floating point numbers, and all the problems that introduces.

If you have good language support and can afford the overhead, you want to replicate that behavior in the type system as some sort of tagged union:

    data SentinelInt32 = NAN | Int32
Or, more likely, using the equivalent of Optional<T> that is part of your languages standard library.

Of course, this means boxing all of your numbers. You could also do something like:

  type SentinelInt32 = Int32
Then provide alternative arithmetic implementations that check for your Sentinel value(s) and propagate the appropriately. This avoids the memory overhead, but still adds in all the conditional overhead.
reply
HdS84
1 month ago
[-]
999 or 9999 etc. are extremely common in traditional statistics, especially because there is no known good sentinel value. In many cases I wished that they used the maximum value as a sentinel, e.g. take 255 for a short as invalid and make only -244 to +244 normal numbers.
reply
addaon
1 month ago
[-]
As someone else who regularly uses 8.93 bit words for computations, I understand completely.
reply
xen0
1 month ago
[-]
On the other hand, an advantage with using a valid 'zero' value as a default state is that nothing will break when given it.

It's a perfectly valid location whereas 'sentinel' values are not.

reply
ksp-atlas
1 month ago
[-]
This is why languages that require handling null properly (such as Zig) are important
reply
BWStearns
1 month ago
[-]
There was a drone that had a new return home failsafe mechanism (for when there's low battery or some fault etc). Unfortunately it was possible to misconfigure it so that home was not set and the failsafe was still armed. This led to several drones perishing in the Atlantic as they bravely tried to fly home to Null Island.
reply
dgfitz
1 month ago
[-]
An old mmo, Star Wars galaxies, when it first released back in like 03 or 04, had an issue where, over time all the player-built buildings would slowly drift towards 0,0 of whatever planet they were on.

Not nearly as impactful as your example, but amusing I suppose.

reply
gorlilla
29 days ago
[-]
In ARK: Survival Evolved items would simply vanish from inventories and end up.on the ground at 0,0. Tamed di osaurs would disappear from a sealed enclosure, only to be found standing right there at 0,0. :)
reply
ausbah
1 month ago
[-]
is there a link to this?? hilarious to see images or smth like
reply
Dwedit
1 month ago
[-]
This is very similar to the geolocation systems where whenever they had no information other than "United States", they pointed to a specific farmhouse in Kansas. Unwanted visits from Police, FBI agents, and people seeking revenge.
reply
jwilk
1 month ago
[-]
reply
Terr_
1 month ago
[-]
Isn't that an argument for nulls in data, rather than against them? :p
reply
audiodude
1 month ago
[-]
Philosophically, you could make the argument that it really does exist.
reply
samatman
1 month ago
[-]
It definitely exists.

It isn't an island, despite having Island in the name. But that's true of Coney Island as well, and it also exists.

reply
killion
1 month ago
[-]
In the Bay Area there is Alameda Island, which didn't start as an island either...

https://www.kqed.org/news/11983858/alameda-the-island-that-a...

It's only barely one today.

reply
cperciva
1 month ago
[-]
Coney Island was an island when it got its name, though.

A closer analogy might be Vancouver's False Creek, which as the name suggests is not a creek (it's a tidal inlet).

reply
samatman
1 month ago
[-]
There's always Rhode Island. There is an island by that name, but the state itself is very much not (and it's usually called Aquidneck now, the island, I mean).

Pine Island in New York State is both not an island, nor named after one, it's just slightly elevated.

Point is there's precedent.

reply
ianburrell
1 month ago
[-]
Creek for inlet is British variant and fairly old.

Chelsea Creek in Boston empties Mill Creek.

reply