When I moved out here two years ago, I figured 80% of the startups out here were in Mountain View, Palo Alto, and Cupertino. I was pleasantly surprised how many startup are in the city ("the city" is what locals call San Francisco).<p>You can't go wrong either or... it depends on your needs and there is no right answer. Both are good options.<p>A few tips: Try to be within reasonable walking distance of either a BART station or the Caltrain. This will give you an excellent public transportation option to easily bypass freeway gridlock when travelling between the Peninsula and SF.<p>Also, a good option may be a happy middle... such as San Mateo or Burlingame. There are startups here as well and you wouldn't be more than 30 mins on the train to Mountain View or SOMA, San Francisco.<p>EDIT to add disclaimer: I live in MV within walking distance of YC actually. It's very nice but also an hour to SF on the train.
In my own personal experience, I've found that there seems to be a cultural difference between the two locations. The nexus of enterprise/SAAS seems to be firmly seated in the Peninsula, while consumer/apps is in SF. That's not a universal rule, but seems to be the predominating trend amongst the type of companies in each general area.
Checkout Redwood city, easy access to the train and closer to Palo Alto.<p>One thing to realize is that the Peninsula is where us old farts with kids live, if I was single I would live in the city.