I lived in the Castro neighborhood of San Francisco for 35 years and got fed up with the homeless people going through the garbage, the car break ins, people urinating in the alley along side of my house and the muggings. I got up one morning to clean up the garbage that I had put out the night before and when I opened my front door I found two guys shooting drugs on the front porch. I had enough!!!! The Castro is one of the highest rent neighborhoods in the City and I wanted something better. I have friends that are artists at the Hunters Point Shipyard community and they have always told me about how quiet it is... and of course I had my doubts, but when a townhome became available I thought I have nothing to lose.
I have lived in the Hunters Point neighborhood for 1 year and find that my doubts were not founded in reality. The police have a training facility at the Hunters Point shipyard so there is a police presents all the time and Lennar corporation has started construction of 1600 homes at the corner of Donahue and Innes Street. You can't walk to coffee yet but you aren't hassled by homeless people wanting spare change.
If you have concerns about crime in San Francisco neighborhoods I suggest that you access the SFPD Crime Map. The map allows you to scan the entire city. I think you will find that crime is everywhere and you need to use caution when you are out and about.