Can't get no satisfaction

Hard to believe or not, software developers are people. They feel a mixture of dread and anticipation as they consider the day's work ahead of them, just like anyone else. And the way that they feel directly impacts their productivity, just like anyone else. As Martin Fowler wrote:
I can hear many people wondering who cares about whether developers enjoy their jobs. Actually I think it's very important. A team that's enjoying their work is a team that's motivated to do good work. In raw business terms, this translates to much higher productivity and better value for your development budget. I've always argued that development managers should devote a good proportion of their energy figuring out how to motivate and energize a development team.
The problem is that it is much easier to demotivate a team than to motivate it. (And when a team reaches rock bottom, almost any motivational effort - no matter how well intentioned - will be misinterpreted as it filters through the layers of negativity and cynicsm.) So what is a manager to do? Simple: try to treat your teams like people, as you yourself would like to be treated.
Make the effort to get to know your developers, acknowledge their individuality, and recognise their desire for self-expression. Offer assistance when they are stuck or direct them to help when they appear to need it (heeding the messenger however the message is expressed). Ask them for their suggestions, and provide feedback if the ideas are politically or economically infeasible. As Hal Macomber also wrote at about the same time as Martin's post:
It's time we stopped acting like good technical wisdom is what makes for good project management. It doesn't. Likewise, accountability, authority, and responsibility [...] don't make a project manager. Let's try care, guidance, attention, listening, and openness.