If you look at a picture of pretty much any part of San Francisco on street view in Google Maps, it shows a densely packed block of row houses, often on a narrow street. Everything seems packed in instead of spread out. Most other American cities seem to have a small, dense urban core surrounded by miles of single-family homes. The only other big cities we really see the same type of packing are New York, Boston, and Philadelphia, which are all older, East Coast colonial cities. And even those cities experienced sprawl. So why didn't San Francisco?
The city of San Francisco developed in the 19th century, a dense port and mercantile city similar to Baltimore, Philadelphia, or Brooklyn—but even more constrained by geography until the Bay and Golden Gate bridges opened in the 1930s.
Since World War II, the Bay Area has sprawled in the same way as other US metro areas: accelerated by the move of port operations to Oakland and Alameda and the parallel growth of San Jose and the Silicon Valley. Growth in the region has been complicated by coming up against various areas of mountains, public lands, or extremely productive agricultural areas. But the commutershed has now reached through Altamont Pass to spill into California's Central Valley.
The degree of sprawl can't be determined by looking at the building pattern in one small part of the metropolis. If you sort US urbanized areas by population density, LA is first, the Bay Area second, and San Jose third. New York is Fifth. In California, where water distribution is always an issue in urbanization, the density gradient falls off very quickly at the edge of the urbanized area. Places like Boston—even though they look dense in the center city—fall to 150th because the very-low-density exurbs go on forever.