InscalarlanguageslikeFORTRAN77, C, Pascal, Ada, etc. operationsapplyonlytosinglevalues, so "a"+"b" expressestheadditionoftwonumbers. Insuchlanguagesaddingtwoarraysrequiresindexingandlooping:
FORTRAN77
00DO10I = 1, NDO10J = 1, N10A(J,I) = A(J,I) + B(J,I)Cfor (i = 0; i < n; i++) for (j = 0; j < n; j++) a [i] [j] += b [i] [j] ;PASCALfori:=1tondoforj:=1tondoa [i,j] := a [i,j] + b [i,j] ;Thisneedtoloopandindextoperformoperationsonarraysisbothtediousanderrorprone.
Inarraylanguages, operationsaregeneralizedtoapplytobothscalarsandarrays. Thus, "a"+"b" expressesthesumoftwoscalarsif "a" and "b" arescalars, orthesumoftwoarraysiftheyarearrays. Whenappliedtoarrays, theoperationsactoncorrespondingelementsasillustratedintheloopsabove. Indeed, whenthearraylanguagecompiler/interpreterencountersastatementlike:
A:= A + B
where "A" and "B" aretwo-dimensionalarrays, itgeneratescodethatiseffectivelythesameastheCloopsshownabove. Anarraylanguage, therefore, simplifiesprogramming.
Programming language — lists Alphabetical Categorical Chronological Generational A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that… … Wikipedia
Array data type — Not to be confused with Array data structure. In computer science, an array type is a data type that is meant to describe a collection of elements (values or variables), each selected by one or more indices that can be computed at run time by the … Wikipedia
Array — In computer science an array [Paul E. Black, array , in Dictionary of Algorithms and Data Structures , Paul E. Black, ed., U.S. National Institute of Standards and Technology. 26 August 2008 (accessed 10 September 2008).… … Wikipedia
Array Theory — From [ftp://ftp.nial.com/nial.com/Papers/Papers.zip Nial Papers] : Array Theory is primarily a theory about the definition and manipulation of array data objects. Every data object in the theory is an array, even numbers and characters, which are … Wikipedia
Programming style — is a set of rules or guidelines used when writing the source code for a computer program. It is often claimed that following a particular programming style will help programmers to read and understand source code conforming to the style, and help … Wikipedia
Programming paradigm — Programming paradigms Agent oriented Automata based Component based Flow based Pipelined Concatenative Concu … Wikipedia
List of programming languages by category — Programming language lists Alphabetical Categorical Chronological Generational This is a list of programming languages grouped by category. Some languages are listed in multiple categories. Contents … Wikipedia
Array slicing — In computer programming, array slicing is an operation that extracts certain elements from an array and packages them as another array, possibly with different number of indices (or dimensions) and different index ranges. Two common examples are… … Wikipedia