SF.  South Bay is really boring.   I just moved from SF to Mountain View, and getting bored as hell.<p>Berkeley is fun, and cheaper than SF, plus there are girls there.  
One word of advice: Don't get a first floor apartment. it seems that break-ins are really common, mostly b/c of the proximity to west oakland, which honestly,  makes Baghdad look good.<p>Palo Alto is Ok too. 
SF, is the more fun, but more expensive too.<p>Anywhere else is really suburban and boring.<p>But if you find a job in South Bay (where most tech jobs are), then you don't want to live in Berkeley, as it is too far.