> let die = Uniform::from(1..7);
I think this is a good example of the bad consequences of zero-based indexing. First, I hope you agree that a line of code describing a six-sided die should never feature a literal 7!
But zero-based indexing causes us to embrace exclusive ranges: if we want 6 numbers, we write 0..6 and that’s fine.
If you want 6 numbers starting at 1, then you must use an inclusive range operator, since you don’t want to bring the irrelevant number 7 into the picture. Now Rust has that: ..= and the author should use it here. But e.g. Python does not. Personally in Python, I would still refuse to write 7 and write range(1, 6+1) instead, but that’s most people would write range (1, 7).
Which brings me to my point: I’m not trying to argue against zero-based indexing, but I believe that
(a) programming language designers (e.g. Python) don’t recognize sufficiently that it has downsides as well as upsides, and languages need to provide things like inclusive ranges, even if they don’t actually provide 1-based indexing, since 1-based indexing scenarios do naturally occur when programming. It seems that Julia is an example of a language that has very much recognized that both sides have merit.
(b) In the standard case of a language that basically adopts zero-based indexing (most modern languages), 1-based thinking should not be presented as somehow vulgar or ignorant. A good test of whether your language is too hardline on zero-based indexing is: would you ever see users of your language using the literal 7 when describing a six-sided die? If you see that happening, the language is being too hardline on zero-based indexing; either you don't provide inclusive ranges or they're not promoted enough in the documentation.