I'd say write manageable programs.
The uglier the codebase gets, the more I hate coding it.
If the codebase is well-thought and easily extendable, coding is mostly fun and you get pleasure out of beautiful execution.
Best case, you can find pride and joy in something about your programming other than the technical excellence. However, that depends on you personally caring about the purpose of your code's existence.
Of course, left to their own devices, a bunch of engineers could be very happy and ship nothing useful. So you have to impose some sort of balance in a business environment. However, it's an interesting management problem to allow people enough time and autonomy to be proud of their work, while still accomplishing what needs doing. Ideally, with happy engineers, more gets done, and it pays off.