Yeah, you're naive.
Yes, there are slightly more violent crimes in Oakland than San Francisco (and there's more property crime in San Frnacisco)[1], but on the whole they are pretty equivalent in terms of safety; especially if you stick to the 'nicer' areas of both.
[1] http://www.sfgate.com/crime/article/Crime-up-in-Oakland-much...