Other spreadsheets solve this by updating references if you need to add more columns and rows (or at least they try). Is the additional complexity of the infinite grid something that customers actually need?
Updating references accross python scripts seems tricky. For example there would be no way to figure out how this code snippet should be updated if a row was added:
i = get(url).json()['index']
r = avar + offset
out = cell(r, i)
As to the question do customers need an infinite grid... I am asking myself the same question.
That would pose issues when iterating over a range that crosses the X/Y axis, you'd need special case for this. Or you might say that -0 +1 = 0 but I think that would probably break some fundamental properties of the ring of integers.
>Zero-based numbering creates an asymmetry across the grid origin making it difficult to notice the subtle “off-by-one” mismatch between two seemingly symmetrical cell references.
No, it doesn't... the fault is assuming that the cells have a "width", or alternatively, that the cells coordinates aren't in the center of the cell.
If you treat the cells as if they are centered on coordinates, the problem is resolved. (-2,0) is 2 to the left, and (2,0) is 2 to the right of the origin.
[Edit] I'm not talking about the display format, I'm talking about the representation/metaphor... it doesn't matter how things look on the screen... -2 is 2 cells left, +2 is 2 cells right of 0.
>If you treat the cells as if they are centered on coordinates, the problem is resolved. (-2,0) is 2 to the left, and (2,0) is 2 to the right of the origin.
The issue is the row-0-column-0-cells are themselves also "containers" and making those cells "inclusive" of either the positive or negative range of cells will make it asymmetric.
The problem with the screenshot is that it measures to a different location of each cell. They measure to the top-left of (2,2), but the bottom-right of (-2,-2).
I am glad they started brainstorming how to implement my suggestions for named cells and named ranges [1]. Having complex spreadsheets than span through infinite will be unmaintainable relying only on coordinates
n prefix to indicate negative is a strange choice. I suspect it will have unwanted repercussions, i.e. what about a variable named `n`?
I'll admit though, I'd never really considered that overloading the dash symbol to mean so many things was strange until I read this. It still seems like inventing a new nomenclature for negative numbers is a bit reaching for spreadsheet software.
edit
I'm not sure I understand what problem is being solved here either. What does negative spreadsheet indexes give us that positive-only indexes didn't?
edit 2 None of this is to downplay what OP & co is doing here. I'm hugely thankful for the community behind any effort to open source key pieces of technology. I don't use spreadsheets on a regular basis, but when I do, I am always impressed by their ability to flexibly solve problems. Awesome work making this technology modern and open source.
I think there is a symmetry problem, there is a A and a nA but not a 0 and a n0 ... It might feel weird but it might also avoid issues to simply forget about nA and go nC, nB, A, B, C and so on, to have the same mapping between numbers and letters.
I think the thing is that from cell An2 adding 4 should bring you to A2 not A1 but no matter what it seems like a lot of mental strain to work across those negative quadrants
16 comments
[ 3.2 ms ] story [ 54.4 ms ] threadi = get(url).json()['index']
r = avar + offset
out = cell(r, i)
As to the question do customers need an infinite grid... I am asking myself the same question.
https://en.wikipedia.org/wiki/Negative_zero
No, it doesn't... the fault is assuming that the cells have a "width", or alternatively, that the cells coordinates aren't in the center of the cell.
If you treat the cells as if they are centered on coordinates, the problem is resolved. (-2,0) is 2 to the left, and (2,0) is 2 to the right of the origin.
[Edit] I'm not talking about the display format, I'm talking about the representation/metaphor... it doesn't matter how things look on the screen... -2 is 2 cells left, +2 is 2 cells right of 0.
The article's screenshot already shows the cells "centered on the coordinates": https://www.quadratichq.com/assets/blog/2023-05-15-coordinat...
The issue is the row-0-column-0-cells are themselves also "containers" and making those cells "inclusive" of either the positive or negative range of cells will make it asymmetric.
The obvious solution to which is to use indices of ..-3/2, -1/2, 1/2, 3/2, ...
If I have a formula in cell C4 saying "=$A4 * $A$1 + B4", that would translate to a formula in cell R4C3, "=RC1 * R1C1 + RC[-1]".
The relative references are much clearer. If you "fill" a formula it looks the same everywhere.
[1] https://github.com/quadratichq/quadratic/issues/408
I'll admit though, I'd never really considered that overloading the dash symbol to mean so many things was strange until I read this. It still seems like inventing a new nomenclature for negative numbers is a bit reaching for spreadsheet software.
edit I'm not sure I understand what problem is being solved here either. What does negative spreadsheet indexes give us that positive-only indexes didn't?
edit 2 None of this is to downplay what OP & co is doing here. I'm hugely thankful for the community behind any effort to open source key pieces of technology. I don't use spreadsheets on a regular basis, but when I do, I am always impressed by their ability to flexibly solve problems. Awesome work making this technology modern and open source.
But what is the advantage to having the negative quadrants? Couldn’t the positive quadrant extend to infinity and still be considered infinite?
I suppose that not having any way to run off the edge would be nice but at the same time it looks like it introduces more complexity
Since .xlsx and .csv will be how you eventually export these files if any non-programmer needs the data then how will the translation be handled?