It depends on the ‘level’ at which you employ this creativity. To me, neither coding nor writing requires much creativity at a very low level (think inside a function or a paragraph), but it does require creativity as much as the ability to analytically extract suitable abstractions at a higher level.
That is, once you created (using your creativity) some sort of flow-chart for either your programme or your story, you will be able to fill in the remaining bits using strictly analytical thought without much creativity: Once you created pseudocode for Dijkstra’s algorithm, you don’t need much creativity to implement it. Similarly, once you set up the story of your genius cheating the devil, you don’t need much creativity to fill in the gaps.
The quality of this gap-filling will still greatly depend on your skill as a coder/writer – making the best use of the language you have – but this is not a necessarily a creative process, unless your language is ill-suited to the task and you need to create it on-the-fly, c.f. Shakespeare or K&R. Neither Goethe nor Thomas Mann made up many words, but only used their tools at a very high level and are still considered among the best writers in the world. Similarly, Linus didn’t invent C, but he used it to build a very complex system (or randomly ended up at one by continuous evolution, though that’s another discussion).
The above obviously only applies to writing/coding, and I would assume that the same goes for composing – even more so, as you can choose a particular set of rules (harmonic, atonal, you-name-it) and each individual note follows from the previous with little choice. Bach’s Well-Tempered Clavier is probably a good example for this.
On the other hand, at least to the uninitiated (read: me), painting and sculpting appears much more ‘creative’ and incomparable to coding/writing/composing.