10 ms·
I think the dependencies they're talking about are something like A1 = C3*C5, C3 = B2+5, B2 = 12, C5 = 13... to determine the value of A1 you'll need to know th
by munk-a 4y ago
I think the dependencies they're talking about are something like A1 = C3*C5, C3 = B2+5, B2 = 12, C5 = 13... to determine the value of A1 you'll need to know the values of C3 and C5 which then depend on B2 so simply computing cells in ascending order wouldn't work for the first iteration and saving the dependency between cells would probably let you work a lot more efficiently as data in the sheet changes.
Also, I gave a dumb example involving four cells - some spreadsheets involve thousands of active cells with complicated interdependencies, conditional formatting and hidden ranges... these large sheets are usually rather responsive for how much unstructured complexity is in them.
- PaulHoule 4y agoExactly, you could write formulas like that in Python but you would need to spell out the exact execution order, which is "one more thing you have to worry about" that divides professional programmers from everyone else. At an introductory level it doesn't seem like much but there is a certain point in complexity where it becomes a major burden, particularly when it comes to composing complex systems out of multiple parts. That's how frameworks like Guava and Spring banished the Factory, FactoryFactory, FactoryFactoryFactory, FactoryFactoryFactoryFactory, ... pattern in Java by creating a MetaFactory that sees the relationships between all the parts as a whole and resolves all of the things that would seem circular if you didn't carefully tease them apart manually. Things of this type, however, have a remarkable ability of "slipping people's minds" and you still hear people complaining about the Factoryⁿ problem in Java which is so 1998.