Why Software Should Never Replace a Missing Time with a Default Value
A software engineer writing for DEV Community argues that substituting a missing time field with a default value like midnight or noon silently converts unknown data into false facts. The problem is especially consequential in domains such as medical timelines, legal deadlines, and astrological calculations, where the hour of an event can materially change the outcome. The author illustrates the issue through a BaZi chart pipeline, where inserting a fallback birth time makes output appear complete while undermining its accuracy. To preserve the distinction between observed and inferred data, the article recommends using a discriminated union type that forces downstream code to explicitly acknowledge when a time value is unknown. The approach is presented as language-agnostic, applicable across TypeScript, Rust, databases, and data-serialization formats.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in