Programming is a means to an end for me, not an end unto itself. I like to make products, and—in many cases—the path of least resistance is to write code to make that happen.
As a result, my happiness as a programmer is directly correlated to how much user impact I see in the work I'm doing.
I also love my immediate coworkers, which helps immeasurably :)
edit: I'm in my 13th year of professional software development, and I have worked at a company where I can reasonably expect a 40 hour work week for the past 2.5 years. My stress level is at an all time low, which helps my happiness, too.
As a result, my happiness as a programmer is directly correlated to how much user impact I see in the work I'm doing.
I also love my immediate coworkers, which helps immeasurably :)
edit: I'm in my 13th year of professional software development, and I have worked at a company where I can reasonably expect a 40 hour work week for the past 2.5 years. My stress level is at an all time low, which helps my happiness, too.