oops.... when I said (sorry) I meant that as an apology for
restating the obvious! Not as a satirical aside :~(
programming concepts. Is it possible that arrays are more significant
doing other types of development? Perhaps that is why it figures
in the curriculum. On a personal note, I have for some time used
Well, I had a friend at university who was irritated to find the lecture
notes still said '1956' in the bottom right corner.... I think that is why
the 'array' figures in the curriculum!
OK, that was a little unfair. An array is a simple basic way of looking at
a data set, and even if it is now of limited use to a developer, it is still
helpful in describing structures. For example, how would you describe the
routing table in a router? It is typically a statically allocated memory
area with a two dimensional numeric index accessed through a hash table,
even if it wasn't originally declared as an 'array'. Or how would you
describe the data on a graphics card? Typically each point is processed as a
matrix of local points, and array syntax is the same as matrix syntax.
However, a major reason for using an array is the lack of some other
structure, so developers use arrays a lot less than they used to, and
database developers have even fewer places to use an array than any other
kind of developer.
Mathematicians and Engineers had been dealing with tables of data before
Excel and Access had been dreamt of, and the table structure got the name
'array' when FORTRAN was developed. It was a statically sized structure and
FORTRAN did memory allocation for data at compile time.
For most development now you would expect to see dynamically sized storage
elements used more than statically sized storage elements, and even when you
have a statically sized storage element called an 'array', that key word
typically is not used. VB is unusual both in using that keyword and in
having a dynamically sizable array structure.
Access was unusual in having a persistent/streamable array structure (the
table). Other modern languages do have persistent/streamable dynamic data
structures now, but they are often called neither 'array' nor 'table'.
In the absence of a persistent/streamable dynamic data structure,
programmers used to have to use what they had. They built static data
structures for fast access, and wrote their own streaming code to get
to/from disk. Access no longer has it's own programming language (Access
Basic). Instead, the tables and recordsets are part of the ADO/DAO objects.
The table structures that VBA/VB/VBS natively support are only Array and
Collection. In C++, most of the dynamic data structures are technically part
of the library, rather than native parts of the
language specification. Again, an Array is a native part of the C++ base
language. This doesn't make an array an import structure for a developer,
but it does mean that an array is an important structure for a language
student!
Situations where someone might use a simple array: If you LACK other
language structures, or if you need low-overhead, low-memory, and
fast-access, or if your data is natively indexed numerically, is static and
multi-dimensioned, or if your data is so semantically simple that you can't
be bothered with another structure, or if your language maps another data
structure onto a simple array (for example, it is common to map strings as
an array of characters, although that is not true in VB).
And finally, what you asked for in the first place, places where I have used
arrays:
Analysis of electrical signals where the Math library used arrays, hash
tables before the PC got so fast that hashing became irrelevant, string
manipulation in C and Pascal, control arrays in VB, hardware IO for embedded
systems (including hardware access on the PC before the PC was virtualised),
caching data for speed and stability in Access before collections and
disconnected recordsets became available, streaming of persistent data in
Pascal and BASIC, passing data between processes (VB to C++), MAX,AVERAGE
and other statistical functions in FORTRAN (a language that did not support
SQL), and embedded strings in a language that supported neither streaming
nor resource files. That's all I can think of, there is more, but I think
that's representative of my career :~)
(david)