I am (or was) a professional music producer, had great carrier in my 20s ~ mid 30s. Also produced couple of national hit songs with famous singers (South Korea). Now I'm working on my own company as a CEO and lead server engineer.
I can surely tell you, coding is more like an art than science. If you deeply know how to 'enjoy' good music, that, can also make you a good music producer as well.
What makes a great music? is having a same lame solid pattern and structures over and over again but able to implement unusual unpredictable element at some points. And I believe that approach also applies when writing a good code as well.