{
  "id": 80384,
  "title": "Code Smell 208 - Don't Use Null for Real Places",
  "url": "https://urgent.news/2026/08/03/code-smell-208-dont-use-null-for-real-places",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-03T03:11:23.000Z",
  "source": {
    "name": "HackerNoon",
    "slug": "hackernoon",
    "url": "https://hackernoon.com/code-smell-208-dont-use-null-for-real-places?source=rss"
  },
  "original_language": "en",
  "account": "Null Island, a fictional location at 0°N 0°E in the Atlantic Ocean, has become a popular reference point for geographic information systems and mapping software. Many GPS systems place data with missing or invalid coordinates at this exact spot, where no landmass exists. Data visualization specialists started using the term around 2008 to help filter out errors in location data.\n\nResearchers found over 300,000 geotagged photos and countless social media posts referencing Null Island, including during the COVID-19 pandemic when Johns Hopkins plotting dashboard used it for missing real locations. To avoid using null for real places, you can model unknown locations polymorphically, creating distinct types for known and unknown locations.\n\nIn code, instead of using a (0.0, 0.0) sentinel value, create an abstract Location class with methods for distance calculation and handling unknown locations. Define specific classes for Earth locations and unknown locations, each implementing the necessary methods. When processing a list of locations, use the ifKnownOrElse method to apply known actions to Earth locations or unknown actions to unknown locations, ensuring a clear distinction between real and missing data. This approach maintains the bijection between your model and the MAPPER, preserving the relationship between real coordinates and real places on Earth.",
  "summary": "Learn why using (0, 0) for missing coordinates creates bugs and how a polymorphic Location type keeps Kotlin models accurate.",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}