This will sound patronizing if you've actually lived here but... you do know that San Francisco is not "the valley", right? The "valley" is Santa Clara Valley , which is a full 45 miles away and a very diverse set of neighborhoods. "There are no slums. There are no marginal areas." I've lived in "the valley" my whole damn life. My family has ties going back to the gold rush days. I have no idea where it is that you l…
As for slums and marginal areas -- yes, they exist, but even there the costs of living can be high, and in terms of livable low-cost areas, such as you might find in Chicago, or Detroit, or Berlin, not so much. Land-use planning, growth limitations (California is ultimately water-constrained), NIMBYISM, and real-estate inflation have and are taking their toll on the area.