Talk:Array: Difference between revisions

3,550 bytes added ,  15 years ago
 
(5 intermediate revisions by 4 users not shown)
Line 34:
 
::: "Array" seems to be one of those words meaning all and nothing in the same time. The fact that we need an extra adjective to specify it better (multidimensional, associative) seems to confirm it. As concept it has a broad sense. As "thing", it seems it depends a lot on the language: PHP and AWK e.g. call array what it's clearer to call hash table or associative array; C has only arrays indexable by an integer (or two, or three etc. ints for multidimensional arrays), and so it is for e.g. Fortran, Pascal (as far as I can remember) and more langs. As suggested, maybe this page should become an "umbrella" for more specific kind of data structures that can be grouped as "(adjective) arrays". (Maybe ''array'' is used as synonym for ''collection''?) --[[User:ShinTakezou|ShinTakezou]] 12:53, 3 April 2009 (UTC)
 
:::: I agree that array should become a category with more than one articles in it. To me too, ''Collection'' feels quite close to ''array''. Though it is less oriented on implementation issues, and more on the interface. I believe it was introduced as an [[object-oriented|OO]]-ish substitute for more data/representation-oriented ''array''. --[[User:Dmitry-kazakov|Dmitry-kazakov]] 13:04, 3 April 2009 (UTC)
 
:::[[wp:Array]] and [[wp:associative array]] are both well defined and ''distinct'' terms. Wikipedia has it right. A lowest-common-denominator, generic "array" is presumed to be a contiguous chunk of same-sized objects, accessed via base, index, and stride, as is supported all the way down to the instruction set in most processors. Such arrays have special syntax in most early, low-level languages. Arrays are the building-block of higher-level collections. "Associative arrays" are a class of collections which obey an array-like protocol and which could have a variety of implementations, each with different benefits. Their only similarities are name, protocol, and sometimes shared language syntax. In my opinion, they should be kept very distinct on Rosetta Code, following the example of Wikipedia. --[[User:IanOsgood|IanOsgood]] 13:15, 3 April 2009 (UTC)
 
:::: Fundamentally I agree. (Except in some wording, maybe often computer scientists fail using human language? Array can't be too much distinct from "associative array", or we should call "array" ''abraca'' and "associative array" ''salakur''; otherwise the idea is that an associative array is just an array, one of the possible kind of; forget it if you did not mean that an "associative array" is not an "array") --[[User:ShinTakezou|ShinTakezou]] 15:09, 3 April 2009 (UTC)
 
:::::Associative array is not an array, just like butterfly is not a fly. Of course it is possible that the data of an associative array is internally stored in an array. After all, a real associative array can not exist in normal computer memory, you would need special hardware. Array is quite a clear concept, as specified in Wikipedia. For example, it is always indexed with integer. (Note: enumeration type ''is'' integer).
:::::I think this page should be an encyclopedia article. Then, some tasks could be created for performing some specific array operations. There is already at least [[Array Initialization]] and [[Creating an Array]]. Maybe there could be a category for grouping these. --[[User:PauliKL|PauliKL]] 16:25, 3 April 2009 (UTC)
 
:::::: <nowiki>[</nowiki>Please do not feed my interest in word-playing or filology by writing such a nonsense thing like "associative array" &ne; "array" deduced by "butterfly" &ne; "fly"; it's a completely different thing! I couldn't help answering this with at least this ''bit'' :D<nowiki>]</nowiki> --[[User:ShinTakezou|ShinTakezou]] 22:42, 3 April 2009 (UTC)
 
::::::Enumeration is not an integer, except than in C, which, honestly, does not have enumerations. Let us not confuse ''named integer constants'' with enumeration type. Integer is a datatype that provides a certain set of operations ([http://en.wikipedia.org/wiki/Peano_arithmetic Peano arithmetic]). Enumeration is a set of values without such operations except for comparison and copy.
 
::::::The key logical difference between associative and "plain" arrays is that the index of former is not necessarily dense, which does not allow iteration. The commonality is that both are maps of index to element. --[[User:Dmitry-kazakov|Dmitry-kazakov]] 08:27, 4 April 2009 (UTC)