A lot of the same reasons that Fred Brooks listed in The Joys of the Craft in The Mythical Man-Month:
1. The sheer joy of making things.
2. The pleasure of making things that are useful to other people.
3. The fascination of fashioning complex puzzle-like objects of interlocking moving parts, and watching them work in subtle cycles, playing out the consequences of principles built in from the beginning.
4. The joy of always learning, which springs from the nonrepeating nature of the task.
5. The delight of working in such a tractable medium. The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of imagination.
Not inclued in the list above is the insight "find the right approach and suddenly the problem just goes away". It ties in with this quote from Linus that I really like:
"Bad programmers worry about the code. Good programmers worry about data structures and their relationships."
I enjoy programming games and other things as a hobby, but the work can fall short of your points especially in my experience in web development:
2. After days of work, your entire branch can be discarded when the feature spec changes
4. Repetitive tasks abound
5. Not so much creating from pure thoughtstuff, but rather intractable legacy codebases on top of bothersome system configuration
Your last quote sounds nice, but ignores the reality of coding. Even good coders have to write ugly (hard to maintain regardless of data structures) code sometimes. The real world just introduces edge cases which make even the most beautiful system have warts in places. Web development exposes concurrency, scaling and other things which can lead to tradeoffs against code cleanliness.
1. The sheer joy of making things.
2. The pleasure of making things that are useful to other people.
3. The fascination of fashioning complex puzzle-like objects of interlocking moving parts, and watching them work in subtle cycles, playing out the consequences of principles built in from the beginning.
4. The joy of always learning, which springs from the nonrepeating nature of the task.
5. The delight of working in such a tractable medium. The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of imagination.
Not inclued in the list above is the insight "find the right approach and suddenly the problem just goes away". It ties in with this quote from Linus that I really like:
"Bad programmers worry about the code. Good programmers worry about data structures and their relationships."
https://henrikwarne.com/2012/06/02/why-i-love-coding/