We currently have a mix of both. We should choose one.
I support 0 and 1. This is used in many mathematical occurrences where t0 instead of t1 means the initial t etc.
That's different. In that case, "0" is used to mean "initial", not "first" (since the initial t is the zero t).
For indices, I've personally seen (x_1, x_2, ...) used more frequently than (x_0, x_1, ...). See https://en.wikipedia.org/wiki/0#Mathematics:
The number 0 may or may not be considered a natural number,
And also https://en.wikipedia.org/wiki/Cartesian_product#n-ary_Cartesian_product:
(x_1, ..., x_n)
Looking at Mojang and Java libraries, it seems 1 and 2 are much more common than 0 and 1. In fact, after doing a search for [a-z]1 all results I found were for something1 and something2. I couldn't find any something0.
mapBoth(final Function<? super L, ? extends C> f1, final Function<? super R, ? extends D> f2);(e1, e2) -> e1 (lambda in CommandNodejava.io.FileSystem: rename(File f1, File f2)java.awt.geom.Line2D: fields are named x1 and x2.I personally use S and E suffixes for these start+end elements, which is imo clearer.
I would personally vote for x1 and x2, as it seems way more common. S and E suffixes only really work when there is an actual start and end, and then I would rather call them from and to.
x0, x1, x2, has little to no meaning for me. I don't think we should really be using them at all.
I'm on the side of @Pyrofab that I'd just call them from and to or start and end with no suffexes.
startX, endX
fromX, toX
minX, maxX
Only need the numbers where there are more than two. x0, x1, x2 and there are no better names to describe them than "one, two, three, first, second, third".
The problem with words like from, start, min is that they say that there is some kind of difference between them. I agree that min and max should be used when one has to be lower than the other, and that start and end should be used if we're talking about something like a path starting somewhere and ending somewhere. But this is about cases in which x1 and x2 can be interchanged.
I agree that min and max should be used when one has to be lower than the other
And yet the fields in Box were renamed from xMin/xMax to x1/x2?
Most helpful comment
I would personally vote for
x1andx2, as it seems way more common. S and E suffixes only really work when there is an actual start and end, and then I would rather call themfromandto.