I think this applies to many creative activities, or even general problem-solving tasks as well. I don't like going through the frustrations of the puzzle-solving process in programming, but it sure increases the accomplishment of having debugged the issue and finished the program, later on.