3 ms·
> Arrays simply do not model any problem that I have at all well Then don't use arrays. However, arrays (vectors and matrices) do model problems that scientist
by warmfuzzykitten 16y ago
> Arrays simply do not model any problem that I have at all well
Then don't use arrays. However, arrays (vectors and matrices) do model problems that scientists and engineers have, and nothing else models them as well or efficiently. So to call arrays harmful is to exclude a large and important class of applications simply because you don't happen to work on them. It would be more reasonable to note there is a need for immutable arrays not met by our current languages.
- jbri 16y agoIs it an array that models your problem efficiently, or is it "an n-dimensional data structure with O(1) lookups by index", of which an array is merely one implementation?
- chancho 16y agoAre there any other such data structures besides arrays and hash tables? (That's only half-rhetorical. I'd love to hear about one.) If so, are you seriously suggesting that when an array fits the bill, we should stop and think "hmm... maybe another data structure would be a better container for this dense, contiguous set of integer keys"?