为什么大多数电子表格都包含行数和列数的硬编码限制?
为什么 Microsoft Excel、Gnumeric 和 OpenOffice.org Calc 等程序在设计时对行数和列数进行硬编码限制?这似乎是一种古老的编程技术,当时电子表格被认为是要求苛刻的应用程序,动态内存分配被认为是“高端”。我猜想这表明某些资源正在静态分配,假设“没有人需要比这更多的资源”,从而在应用程序中引入了非常任意的限制。其背后的逻辑是什么?
注意:我知道有些人会认为这个问题与编程无关。这是一个先发制人的反驳:这个问题与编程相关,因为它询问为什么使用普遍且看似过时的编程方法。
Why are programs like Microsoft Excel, Gnumeric and OpenOffice.org Calc designed with hard-coded limits on the number of rows and columns? This seems like an archaic programming technique from when spreadsheets were considered a demanding application and dynamic memory allocation was considered "high-end". I would guess that it indicates that some resource is being statically allocated, with the assumption that "noone will ever need more than that", thus introducing a very arbitrary limitation into the application. What is the logic behind it?
Note: I know some people are going to argue that this question isn't programming related. Here's a preemptive rebuttal: This question is programming-related because it's asking why a pervasive and seemingly obsolete programming methodology is used.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
最初的原因是为了性能和空间,因为(例如)处理 65536 行只需要两个字节。这些历史原因已经随着 Office 2007 消失了(如果不是其他的),所以你的问题也已经过时了。
The original reason was for performance and space, because (for instance) handling 65536 rows only requires two bytes. These historic reasons have gone with Office 2007 (if not the others as well), so your question is also obsolete.
因为将单元格引用作为一对索引来处理会更容易,但它们最终会受到限制?
总之,无论你做什么都会有一个限度,问题是它会是什么,要花多少钱才能做到这一点,有多少人会遇到它?
Because it's way easier to handle cell references as a pair of indexes and they end up having a limit?
In short, there will be a limit no matter what you do, the question is just what will it be, what will it cost to make it that and how many people will run into it?
下一个 Gnumeric 版本将允许更大的工作表,最多 8M 行和 8k 列。如果您确实需要这么大的纸张,请购买一些 TB 的 RAM。
Next Gnumeric version will allow much larger sheets, up to 8M rows and 8k columns. Just if you really need such large sheets, buy some TBytes of RAM.
在Excel97 biff记录中,列存储为0xff数字,行存储为0xFFFF数字。
所以它限制列为255,行为65535,如果你想在Excel2003中保存更多的行/列(如果IDE支持),它将不会被保存。
In Excel97 biff record,column is stored as 0xff number,row is stored as 0xFFFF numner.
So it limite the col to 255 and the row to 65535,if you want to save more rows/cols in Excel2003(if it is support in IDE),it will not be saved.