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

Quite a few APIs use a pair of `{start, length}` instead, which in the context of the post's example, is even clearer. Empty interval would be `length == 0`, time interval would be a single array of `starts`, etc. Fewer subtractions (to get length) usually end up nicer too.


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

Search: