As metaphors can help people to understand unfamiliar concepts with familiar ones, it seems pretty straightforward that metaphors in computer programming can be very helpful. Since I tend to think highly visually, I have problems with computer programming (which tends to be more naturally suited to people who think “algorithmically”).
When I was studying mathematics, one of the tricks I used to turn Bs into A+s was to figure out how to turn whatever new mathematical concept or equation that was in front of me into a visual representation.
In computer programming, some of the names for concepts lend themselves naturally to visual representations. A ’stack’ is like a stack of bricks, where the first one put down is the last one to be removed, as if you are building or tearing down a wall. A ‘queue’ is like a queue of people, where the last one to be added is the last one to reach the front desk. It’s easy to think of these concepts visually. What about an ‘array’, though? It’s not really that visual (perhaps you can think of an array of things in front of you, but that doesn’t capture the importance of the concept for computer programming). Replacing it with “cubicles” might be more useful. A single-dimensional array is like a line of cubicles. A 2-dimensional array like a wall of cubicles, a 3-dimensional array like a cube of cubicles, and so on. (You can even #define cubicles array and then program with the new name.)
One set of words that is particularly ill-chosen is “compile” and “link”. Uh, guys, these are almost interchangeable in terms of what they suggest to a regular English language person. You don’t need to use an abstract word to describe an abstract process. Rather, you can bring an abstract concept to life by using a concrete word to describe it. Instead, computer programming is littered with zombie concepts - poor, atrophied words that at one point probably had some life in them.
(”Compile” is a good example of this happening. It is probably from L. compilare, which means to plunder. The link is probably from the very visceral situation of piling goods together at some point in the plundering process. This was then borrowed for the concept of putting various written materials together into a single document. Perhaps it was a lively word when this first was done, but in the current context it simply brings to mind a vague notion of putting documents together.)
I’m sure this has been done, but it would be interesting to try a development environment where you can actually insert little icons that visually represent some common functionality, such as a “for” loop (a little motor at the top with a chain with a number next to it that represents how often it will loop?).