Always use [closed, open) intervals
<i>> Never, ever, ever use [closed, closed] intervals</i><p>I’m not really a fan of “never,” or “always” rules, when it comes to programming. I’ve found it’s usually better to have a “make sure to justify deviations from” heuristics.<p>I usually use [closed..open) ranges (as they are called in Swift), but sometimes, an inclusive range is a lot more appropriate, for expressing an operation <i>(for example, I may express a range as start...end, as opposed to start..<(end + 1)).</i>