Rosetta Code:Village Pump/Arrays: Difference between revisions

Content added Content deleted
(agreement)
(merge some array tasks; make other tasks collection-agnostic)
Line 10: Line 10:
I advise being very careful. The problem is that language terminology varies wildly and permitted operations is, if anything, even more differentiated across the languages. What is an obvious merger for one might be a loss of an important subtlety for another. (It was the “aren't really using Arrays” that triggered this message, as it indicated that the author of it might be projecting how one language does things onto others, which is usually a mistake.) —[[User:Dkf|Donal Fellows]] 09:56, 30 July 2009 (UTC)
I advise being very careful. The problem is that language terminology varies wildly and permitted operations is, if anything, even more differentiated across the languages. What is an obvious merger for one might be a loss of an important subtlety for another. (It was the “aren't really using Arrays” that triggered this message, as it indicated that the author of it might be projecting how one language does things onto others, which is usually a mistake.) —[[User:Dkf|Donal Fellows]] 09:56, 30 July 2009 (UTC)
:I agree with this entirely. (Also, if we're going to be specific about the kind of data structure, I would suggest (as opposed to "contiguous memory"): consecutive numeric indexing, arbitrary size, and no greater than O(log n) element access time.) --[[User:Kevin Reid|Kevin Reid]] 11:35, 30 July 2009 (UTC)
:I agree with this entirely. (Also, if we're going to be specific about the kind of data structure, I would suggest (as opposed to "contiguous memory"): consecutive numeric indexing, arbitrary size, and no greater than O(log n) element access time.) --[[User:Kevin Reid|Kevin Reid]] 11:35, 30 July 2009 (UTC)

:I think it would be fine to merge [[Creating an Array]], [[Assigning Values to an Array]], and [[Retrieving an Element of an Array]], mostly as a way to show off a language's built-in syntax for native arrays. I think some of the higher order array tasks ([[Select from Array]], [[Apply a callback to an Array]], [[Sorting an Array of Integers]], etc.) should instead operate on the most convenient collection available to the language, no matter whether it is an array, list or some other collection object. --[[User:IanOsgood|IanOsgood]] 17:16, 30 July 2009 (UTC)