in reply to Code that feels good
What you have expressed here is one of the central themes to a book that I just finished reading. While I will not go into the whole book's story right now, I will say that Zen and the Art of Morotcycle Maintenance contains many bits of philosophy that apply to programming as well as life in general.
While the book has no actual focus on coding, it does begin to explain the mental processes of creativity and scientific method, and as such will make you a better coder. I highly recomend it, as it will help you explore this thought which you have just scratched the surface of.