I generally try to steer away from "that makes sense" assumptions but it really does make a lot of sense. Music has a framework of rules that you you have to stay inside but is flexible enough to create an infinite amount of songs. Programming isn't really all that different.A guy I used to work with claims that some big tech company did a years long study in the 90s about this. They hired a bunch of artists and musicians who had never coded before and turned them into a development team and claimed the results they found were that software development uses more of the creative portions of the brain than the logical portions and that people who are great artists and musicians make the best coders.
I tried to google it and found nothing so I have no idea if it's true, but it's interesting if it is.