San Francisco is one of the few places in America where software engineers who earn hundreds of thousands of dollars a year routinely suffer the indignity of accidentally stepping in a steaming pile of human feces as they exit their crappy, overpriced one-bedroom apartments in the Mission District to grab a $20 burrito and $10 latte. That's part of SF's charm. After all, there's a reason it is, by some measures, the most unaffordable major city in the country.

And while the gap between the middle class and the wealthy is widening in pretty much every American city, San Francisco's 'super rich' tech industry elite continue to lead the way. According to Bloomberg, the gap between the city's 'super rich' and 'middle class' (whatever that means in San Francisco) widened in 2017 by $118,000 to $529,500. On average, the city's top 5% of earners earned $623,310 in 2017, compared with $102,785 for its middle class.

Across the US, the gap increased by nearly 50% between 2012 and 2017, widening from $268,000 to $333,000, per the BBG analysis.

Of course, SF wasn't the only city where the gap between the rich and middle-class widened. Of the 100 cities analyzed by BBG, only 1 - Jackson, Mississippi - saw the gulf shrink, thanks to shrinking average income among the top 5%.

In a testament to the city's dominance as a posterchild for economic inequality, even when the parameters are adjusted slightly to account for a larger number of people in the 'wealthy' category and the bottom rung of the city's economic ladder. In this, the gap between the wealthiest 20% and the poorest 20%, San Francisco still takes the No. 1 spot, with the income disparity widening by $79,600 to $339,900 in 2017. San Jose, Seattle, New York and San Diego rounded out the ranking's top 5.

In another BBG analysis measuring the income disparities within the middle class (which BBG defines as the difference between households in the 30th percentile vs households in the 80th percentile), SF and neighboring San Jose took the top two spots.

And with the cost of living surging across California, it's hardly surprising that the state has seen the largest net loss of residents as frustrated Californians seek more affordable climes like Nevada and Texas. And many of those who haven't left wish they could.