{
  "id": 584043,
  "title": "Building a Stat Comparator That Refuses Invalid Deltas",
  "url": "https://urgent.news/2026/08/11/building-a-stat-comparator-that-refuses-invalid-deltas",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-11T17:02:28.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/ethanjamescolez/building-a-stat-comparator-that-refuses-invalid-deltas-16fm"
  },
  "original_language": "en",
  "account": null,
  "summary": "The article discusses the challenges of creating a comparison table for gear stats in a game, where values can be flat numbers, percentages, or per-second rates, and where items may omit certain fields. The author initially considered joining rows by visible label and subtracting right from left, but this approach led to potential errors, such as treating flat Attack Damage as the same as Attack Damage percentage, and treating missing values as zero. To avoid these issues, the author proposes a safer implementation that involves modeling the comparison result explicitly using a Map keyed by three pieces of semantic identity: stat source (base or inherent), stat key, and stat unit. The result row should preserve more than just two numbers, including the type, source, unit, left value, right value, and delta. The author also emphasizes the importance of using a semantic composite key to ensure that rows with the same stat identity, source, and unit are grouped together, rather than relying on the label alone. This approach can be applied to other fields beyond gaming, such as pricing tiers, analytics, and hardware specifications.",
  "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."
}