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.
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)
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.
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.
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.
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.
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.
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. :)
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.
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.
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.
Original article: https://web.archive.org/web/20160410172437/http://fusion.net...
(I see others have also linked to other related posts)
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:
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:
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.It's a perfectly valid location whereas 'sentinel' values are not.
Not nearly as impactful as your example, but amusing I suppose.
https://news.ycombinator.com/item?id=11466849 (39 comments)
https://news.ycombinator.com/item?id=12259518 (3 comments)
https://news.ycombinator.com/item?id=12274203 (125 comments)
It isn't an island, despite having Island in the name. But that's true of Coney Island as well, and it also exists.
https://www.kqed.org/news/11983858/alameda-the-island-that-a...
It's only barely one today.
A closer analogy might be Vancouver's False Creek, which as the name suggests is not a creek (it's a tidal inlet).
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.
Chelsea Creek in Boston empties Mill Creek.