TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Arrays, What's the point? - Stack Overflow

15 点作者 joel_liu超过 16 年前

3 条评论

patio11超过 16 年前
While that may seem like a silly question, if Java and Ruby both lost the data structure entirely, my code would still function. (The frameworks it runs on, not so much.)<p>It is sort of like a programmer not knowing what a NAND gate is. You could get all crotchety about that, because he couldn't do a single thing without a NAND gate on his current system... but he really doesn't need to know the specifics. Many types of programming (not all, obviously) have abstracted away memory management and have pitiful speed requirements compared to the capacity of hardware (and the bottlenecks don't happen anywhere near application code), and accordingly aside from syntactic inertia there is really not that much of a reason to care about arrays any more than there is to know about your NAND gates.<p>(Edit: It occurs to me that I could monkeypatch Array in Ruby and replace it with an associative array and my site would probably function fine... Maybe I'll try it just to prove a point.)
评论 #410238 未加载
评论 #410501 未加载
presty超过 16 年前
I'm worried that (according to his stackoverflow profile) a 'Long-time Informix user and developer, experienced in C and Unix (many variants)' asks such a question.<p>I mean, seriously?
评论 #410223 未加载
评论 #410384 未加载
abl超过 16 年前
there is also a berkeley CS class youtube video that goes into the differences between a linked list and an array:<p><a href="http://www.youtube.com/watch?v=Wp8oiO_CZZE" rel="nofollow">http://www.youtube.com/watch?v=Wp8oiO_CZZE</a><p>it is a good intro to the subject, however, Shewchuk does not thoroughly explain the difference beetween lookup/ access time and search time for arrays and linked lists. I like the explanation given by the commenter on stackoverflow
评论 #410453 未加载