Sadly, I have to agree with Humboldt.

I work in San Francisco, and when I first got this job, I commuted from East Palo Alto... took about 45-55 minutes, half of which was SLOW moving (10-20 MPH). Plus, I was filling my gas tank once a week @ nearly $50 a pop - I drive a Honda Accord, but use premium gas. Commuting the other direction might actually be worse, since
many people work in Silicon Valley & live in SF, so you're looking at 2 hours a day. And this is precisely why I move to the city, despite the fact that I actually liked EPA (considered the "ghetto") and its cheap rent.

But it wasn't tooo hard of a decision to make, since SF is such a terrific city!
Working in Pleasanton might be more do-able, since as Humboldt mentioned, you can take BART back & forth... might not save much time, but it would save a lot of stress. BART is usually a nice relaxing ride, where you could just sit back and read a book. For me, it would still be hard to give up that extra 2 hours a day, mainly because I have a dog waiting at home - who I can now visit at lunch, seeing as I live only 0.5 miles from work.

But if you're willing to spend that extra time commuting, I'd say go with the Pleasanton option instead. Anyway, that's my 2 cents, but maybe you could compromise... live somewhere like San Mateo, which is halfway between the two, and kind of a cool city on its own. Good luck!