Hi,
When you have a big project with many, many pins then it's MUCH easier to refer to particular I/O by way of a variable name than numbers. Thats what high level languages are all about.
On the the other hand, you might indeed use an array to assign a bunch of I/O pins. Take this example from one of my own programs:
int DI_Raw[] = { 14, 15, 16, 17, 18, 19, 22, 23, 24, 25 }; // digital input pins
int DO_Raw[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; // digital output pins
So, we are back to numbers right!........but in this case you have 20 pins assigned in just 2 lines (instead of 20).
And since it's an array you can set them up all the easier in void setup, again 2 lines instead of 20:-
for(int i=14; i<=25; i++) { pinMode(DI_Raw[i], INPUT); } // set digital inputs, no pullups required
for(int i=0; i<=9; i++) { pinMode(DO_Raw[i], OUTPUT); } // set digital outputs
And then you might use one of them as follows, by simply setting the var i be it directly or as part of a for-next loop etc:-
digitalWrite(DO_Raw[i], HIGH);
Note: the other flexibility of the array is that you can swap pins around by moving them around in the array definition.
Hope that helps.
Ian.