Comparing Basic Programming Fundamentals To Music
Often times when I get stuck with a particularly vexing programming dilemma, I'll try and think how I can relate the issue to music, something I'm quite comfortable with. For example, when I was first learning about the concept of functions and methods, and how they took arguments passed into them, I would think about how I hook up my studio gear. The way sound gets passed through one component to another is a slightly similar concept (ok, there are actually many differences when you really think about it, but that's fine).
Another fun thing I like to think about is how there's so many ways to do the same thing in programming. The different ways you can iterate over collection sometimes reminds me of all the different ways you can play the same thing on an instrument. Like, on bass, I could play one baseline in like 5 different spots on the neck. Each one would sound slightly different. Similar concept with enumerables, only the results don't necessarily sound different...but they do produce different results!
For a beginning to intermediate programmer, relating core concepts to things you are already familiar and comfortable with is a good idea. It helps to make programming less scary and more friendly.