Since you say cost is very important, San Fran is probably not the best.  For a place like you describe you'd be paying about $3000/month in SF, and could find a similar place in Berkeley or Palo Alto for about $2000/month.<p>Between Berkeley and Palo Alto, I recommend Berkeley.  Personally, I love Berkeley and currently live there, but that decision is basically would you rather live in a college-town near SF or a college-town/suburb near silicon valley.  Either way they're all about an hour drive away from each other at most anyway.