Why is Programming Fun?
First is the sheer joy of making things. As the child delights in his mud pie, so the adult enjoys building things, especially things of his own design.
Second is the pleasure of making things that are useful to other people. Deep within, we want others to use our work and to find it helpful.
Third is 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. The programmed computer has all the fascination of the pinball machine or the jukebox mechanism, carried to the ultimate.
Fourth is the joy of always learning, which springs from the non-repeating nature of the task. In one way or another the problem is ever new, and its solver learns something: sometimes practical, sometimes theoretical, and sometimes both.
Finally, there is 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 the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures.
Programming then is fun because it gratifies creative longings built deep within us and delights sensibilities we have in common with all men.