An unofficial, read-only Hacker News reader.

Call Things What They Are (opens external site)

24 points by theanonymousone 3 days ago | www.saturnci.com | 16 comments on HN

View full thread · View on Hacker News

Comment thread (1)

  1. Naming is hard. And I share the frustration. Longer names are a little less wieldy to start, but future readers of the code, including future you, will appreciate the effort.

    One related overlapping problem is the need to also manage dimensions or units of measurement. That's the `_inches` suffix in the article's sample code. More precise, but still binds to legacy U.S. customary units in a mostly metric world. Having plain numeric values carry no units (nor dimensions, though that's more subtle) leads to ever so many errors. The loss of Mars Climate Orbiter, e.g., along heaps of money and hundreds of person-years invested. Wish dimensions and units were more fundamental to mainstream programming language computations. Until then, please consider using libraries that fill the gap such as Pint (Python), ruby-units (Ruby), unitmath (JavaScript/TypeScript), or uom (Rust).