Sunday is always my favorite day — a leisurely breakfast, a second cup of coffee, the Sunday papers, maybe a morning walk.

Like a lot of people, I have mixed feelings about a walk in the city these days. The Sunday before, my companion and I had walked the streets of Washington, D.C., and marveled at how clean they were. On returning back home, it was clear how much of San Francisco was a mess, particularly downtown with its crowds of lost souls roaming filthy streets.

So I decided to avoid the heart of the city and head west, down the hill, across Mission and Guerrero streets, up through Noe Valley, toward the hills. It was a pleasant surprise, even to a grizzled native son.

I went to Billy Goat Hill, an old favorite. Not far away, I found a secret street that led nowhere in particular. I took it and ended up in a Glen Park bookstore where a quartet was playing a jazz version of “On the Street Where You Live,” surrounded by stacks of books.

It’s a bit of a puzzle. How can a city like this have a main street lined with squalor and also have unexpected corners, with what my old pal Kenneth Sproul calls “vistas, sights, neighborhoods and people that make you thankful to be alive and lucky to be where you are.”

Both San Franciscos are on display, often within walking distance of each other. How can this be? I don’t know, but if I were an urban doctor, I’d refer this city to a psychiatrist. It clearly has a split personality.

Let me tell you about my little walk. I headed up 30th Street, past where the J streetcar screeches around the curve. Up the hill, past little Victorian Noe Valley cottages. Working folks used to live there. Now a little old house with a view would sell for more than $2 million. That’s crazy.

Thirtieth Street dead-ends at the foot of steep Billy Goat Hill, with grass as green as Ireland in springtime. It is too steep for a road but there is a switchback trail, and at the top, an amazing view and two big old trees with a kind of swing. Kids get on it and swing out with the city at their feet.

I’m a former kid myself, and I remember how we knew all the names of the plants that grew on these grassy San Francisco hillsides. Not the scientific names, but any city kid can point out the licorice plant, the scissors plant, the tricky pee weed, so named because if you ate it you’d wet the bed that night. The big kids told us that, so it must be true.

Leaving Billy Goat Hill, I followed streets just to see where they led, down and around corners to the edge of Glen Park. I had college friends who lived in that neighborhood. They rented a ramshackle old place and lived in glorious youthful poverty that would be impossible these booming days.

But around one corner I came on Penny Lane, a complete surprise. It is a mostly unpaved country road in the middle of the city. It leads past backyard fences next to a 20-foot-tall wire sculpture and branches off in two small, landscaped foot paths.

And the paths eventually lead to Bird & Beckett books on Chenery Street, where Barbara Hunter was playing a flute solo as part of Sunday afternoon jazz.

All this is in the middle of a cold, hard city that seems indifferent to urban squalor. Yet all three of these Sunday places were made better by caring San Franciscans.

Billy Goat Hill used to be a dead-end place used as a dump: old refrigerators, old stoves, junk. Neighbors, now organized as Friends of Billy Goat Hill, persuaded the city to turn the 3.5-acre site into a park and worked to improve it for everybody.

Glen Park neighbors turned Penny Lane from an eyesore into an urban treasure. They had work days, cleared weeds and built a landscape at the end of the street where they lived. Even small children got to help. Bird & Beckett is kept alive by owner Eric Whittington and neighborhood patrons who buy books there instead of getting them cheaper on Amazon.

There are people like that in many corners of the city — people like Joan Carson and Nancy Windesheim, who organized volunteers and got the city to rebuild the Esmeralda Slide Park in Bernal Heights. “It is taking responsibility for something in your neighborhood,” Windesheim said.

There are more than 200 volunteer community groups in the city, caring for parks, urban gardens, even streets. “Citizen involvement is a very powerful thing to see,” said Charlie McCone of the city’s Parks Alliance, which coordinates volunteer efforts.

Two different worlds in the same city. It’s an urban puzzle.