davedelong / calendar_fallacies

yourcalendricalfallacyis.com
http://yourcalendricalfallacyis.com
127 stars 12 forks source link

"You can represent a year using only number" #95

Open jklausa opened 8 months ago

jklausa commented 8 months ago

Japanese calendar requires you to store a year as a (unicode) string.

令和 6 (2024) is not the same as 平成 6 (1994).

davedelong commented 8 months ago

I like this and want to include it, but I'd like to figure out a better phrasing. When formatting the dates, the premise of needing more than numbers is correct, but they're both represented in memory using only numbers. Reiwa 6 is { era: 236, year: 6 }, and Heisei 6 is { era: 235, year: 6 } (ie, neither need non-numbers to disambiguate them)

jklausa commented 7 months ago

I think it's important to call out both the formatting and storage here. I think you could split it into two fallacies potentially:

— "You can display a year using only numbers", which mentions that you need the kanji to display the era and — "You can store a year using only a number", which would mention you need to store the era alongside the "year number".