Rosetta Code:Village Pump/Arrays: Difference between revisions

Only an array is an array
(Idiomatic array use should beat any forced conceptual model from some language(s), most of the time - to aid language comparison.)
(Only an array is an array)
 
Line 42:
 
:For many tasks, this could end up being a distinction without true meaning. Unless the task is specifically about the distinctions you make above then how a task is implemented should be done in the idiomatic way of a language so we can better compare the languages rather than artificially restricting all languages to use the same meaning for "array". If some languages uses a space separated string of the numeric representation of integers as its array on integers then if the task is to store the first ten integers in an array then print the 7'th member of the array, then I think it would be pretty dumb for that languages example to jump through hoops to store ints in any way other than how it does naturally. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 09:45, 22 July 2013 (UTC)
 
::I think the term "array" should only be used when talking about arrays. A list is not an array. A hash is not an array. An array is something that allows random access, i.e. you can get a specific item directly using index(es). Note that an array does not need to be multidimensional. A single dimensional array is an array, too.
::Indeed, there is no point to include requirement of some specific data structure in the task description, unless the task is specifically about that data structure. Not all languages have all possible data structures built-in. The task description should describe what is the goal of the task, not how to implement it. --[[User:PauliKL|PauliKL]] ([[User talk:PauliKL|talk]]) 12:58, 1 August 2013 (UTC)
Anonymous user