Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This still isn't a complete solution, or at the very least holds non-obvious implications. Specifically, date math is not commutative[0]. And, yes, Postgres or java.time might force any arbitrarily ordered expression to always evaluate the same, but this would be based on some special logic for canonicalizing arithmetic on date expressions.

Do they do this? I don't know.

Even if they could do this in a single expression, there are absolutely scenarios where two date-arithmetic operations may be performed in two separate places in code. If those operate on the same logical date value, then we will see the same commutativity issues.

[0]: My sibling comment on this: https://news.ycombinator.com/item?id=26707864



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: