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

Just for completeness I'll mention that there is another style:

    start, count
This seems to be popular in .NET ecosystem.


That’s for creating an enumerable of discrete integers, not for defining an interval.


If by "enumerable of discrete integers" you meant Enumerable.Range, it's not just that. Other examples include String.Substring, Array.Fill, Stream.Read, Span constructor etc.

If you meant it's not practical for non-integer types such as floats or dates, then of course you are right.


I'd say bound, range is an acceptable way of defining an interval, it can save space for multidimensional intervals, though at the cost of increased computation.


NSRange is defined the same way in the (macOS) Foundation framework.




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

Search: