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

> You really think having a type tells you less than having an int?

In the case of "Month", yes.

Give me stronger types for dates or timespans or instants though.

> Does the int handle rollover? Nope, you have to.

Rollover tends to need handling at the date level to carry the year, so let's be honest, "Month" won't handle rollover properly on it's own either.



> Give me stronger types for dates or timespans or instants though.

So the guideline you're vigorously arguing against you don't actually disagree with at all, you just really, really hate Month for seemingly no reason.

Maybe give the guideline a read rather than just the 2 line snippet someone else posted?

> "Month" won't handle rollover properly on it's own either.

It does by not offering math operators in the first place, avoiding the entire possibility of a rollover from the outset.

Or it could throw on rollover so it's at least an runtime exception instead of a silent failure.




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: