3 ms·
I had an interesting conversation with someone many years ago, possibly Brent Yorgey. We were thinking of arrays in quite different ways. To me, it was a data
by mjd 10mo ago
I had an interesting conversation with someone many years ago, possibly Brent Yorgey. We were thinking of arrays in quite different ways. To me, it was a data structure, with a specific memory layout: a contiguous block of memory containing a sequence of objects of all of the same size, specifically to support constant-time indexing. To him, it was an API, a mapping from non-negative numbers to values, and the underlying implementation could have been a hash table or whatever.
I think we're seeing a similar disconnect here. Some people think a string is a contiguous block of bytes, perhaps with a sentinel value on the end (C string) or a fixed-size count on the front. Others think of it as an API for storing text. These used to overlap, but in recent decades they have diverged substantially. The argument here is about the meaning of the word, not the technical reality of the thing it refers to, so it has no objective resolution.