There are several facets that may be similarities. In both:

  1. First think about the overall story, the design. You know in your head the jist of what you want to do, but not all the little details.
  2. When you sit down to actually put the ideas down on paper, you often can just let your ideas flow out, as if you're in the zone... I imagine the great composers worked this way. The details fill themselves in as you go.
  3. It's only partly a science. There are virtually an infinite number of ways to do anything in software, and the same thing in music. Each person has their own signature.
  4. The finished product can be breathtakingly beautiful to the experienced eye, or it can be off-key and disjointed.
  5. The product (sheets of music or computer code) can't play or execute itself. It needs a musician or computer to perform it.

Often I've thought about these similarities as I engineer software, and I'd be interested to know if anyone else has thought the same thing.