Code Smell 208 - Don't Use Null for Real Places

https://hackernoon.imgix.net/images/RIiBoPtpMiRsMKX3dnzl5gb1Urj1-5c839uz.jpeg

You can avoid null if you try

TL;DR: Don't use null for real places

Problems 😔

  • Tight Coupling
  • Unexpected Results

Solutions 😃

  1. Model unknown locations polymorphically

Context 💬

Null Island is a fictional place that sits at 0°N 0°E, at the intersection of the Prime Meridian and the Equator in the Atlantic Ocean.

Many GPS systems place data with missing or invalid coordinates at this exact point. That's where the name "Null Island" comes from.

There's no landmass at this location. It's open ocean.

This point has become a popular reference for geographic information systems (GIS) and mapping software, because it helps filter out errors in location data.

Data visualization specialists started using the term around 2008, after noticing that failed geocoding requests and invalid coordinate entries often defaulted to (0, 0).

Natural Earth, a public domain mapping dataset, deliberately includes a fictional one-square-meter island at that exact point...

Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE

Read more