Why is this not the end, but the bill?
How do you list an empty range if you have a start and end point? For example, suppose you have a text buffer on the screen and a selection, and the selection has one character, starting with character 12 and ending with character 12. How do you list this range? You list one character starting with character 12.
Now suppose the choices are ZERO characters. How do you list this? If you have a start, size, you just pass zero for size. If you have a beginning, an end, what are you doing? You cannot go 12 and 12.
Now you can say: "well, just donβt list it if its range is empty." Thus, you get a code that should look like this:
var results = from index in Range(selectionStart, selectionSize) where blah blah blah select blah;
and instead I write
IEnumerable<Chicken> results = null; if (selectionSize == 0) { results = Enumerable.Empty<Chicken>(); } else { results = from index in Range(selectionStart, selectionEnd) where blah blah blah select blah; }
which hurts my eyes.
source share