One final point: behavioral economics tells us that we quickly get used to big houses but we never get used to commuting. So when you have a choice, go for the smaller house closer to work.
A thousand times yes. Obviously not everyone has this choice, and it's not practical to move every time you get a new job. But yes, if you have the option, try to keep your commute under 20 minutes.
Want something more quantifiable? Here are two of "The Rules" from Joel Garreau's Edge City, a dated but wonderful book about the building of suburbia:
The maximum desirable commute, throughout human history, regardless of transportation technology: 45 minutes.
Cevero's law of the value of time wasted in traffic jams: People view the time they waste in a traffic jam as equal, in dollar value, to half their hourly wage. For example, if you make $50,000 per year, that's $25 per hour. That means you'll pay $3.12 each way per day to cut 15 minutes off your commute. That's about $125 per month, which scales to about $30,000 in the price of a house.
That sounds low to me—in Southern California that's a rounding error in the price of a home—but it's at least a good starting point. If you can buy a house 15 minutes closer to work for $30,000 more, grab it. If it's $50,000 more, behavioral economics says you should ignore your financial angst and grab it anyway. If it's $100,000 more, you might need to think things through a little harder. Or, as Tabarrok suggests, settle for a small house near work at the same price as the bigger house in the burbs. You probably won't regret it.
Anyway, from personal experience I can tell you that short commutes are great. And the greatest commute of all? A walk down the stairs each morning. That's hard to beat.