The answer should be based on your answers to specific questions, but the most basic will involve your daily activities
1. Where do you work?
2. How far, and how long are you willing to commute?
3. How will you commute? By car? By BART? Car share?
4. How much is your budget for a home
I've had clients who were lured into buying brand new and large homes in Antioch and Pittsburg at a time when they were outbid on homes in Oakland and Alameda where they worked. Pretty soon, the bloom of the rose faded, especially when they found themselves in nearly bumper-to-bumper traffic in their daily commutes, both ways.
They finally ended up selling their homes (their timing was just right because they were able to break even when they sold before the market values of similar homes plummeted).
Then factor in other things like what you're accustomed to
1. Climate (Daly City may be foggier and cooler than Hayward)
2. Academic performance index (if you have schools)
3. Crime statistics. Here's a link comparing Daly City to Hayward http://oaklandca.areaconnect.com/crime/compare.htm?c1=Daly+c
4. Market values --- see http://www.DQNews.com
Then weigh the importance of each, you should be able to reach a decision.