I've been quoting homeless people as saying they dislike the shelters, and find them dangerous and dirty. It leaves city and independent shelter officials grinding their teeth in frustration.

"When I read in the paper the shelters are unsafe and that the staff is abusive, I know that's not the case," says Richard Springwater, a member of the board of Episcopal Community Service, which runs Next Door, a 280-bed facility that is the second-largest in the city.

Operators of shelters and single-room-occupancy hotels used by the city to house the homeless felt so strongly about correcting that perception that Trent Rhorer, San Francisco director of human services, took me on a three-hour tour of some of the shelters Tuesday afternoon. He wanted to show that the accommodations are neither dirty nor unpleasant.

The result? I have to say Rhorer & Co. have a point. At place after place, the beds were clean (mostly metal lately because wooden bed frames encouraged bed bugs), food and medical opportunities were available, and the single resident rooms looked small, but an improvement on a sheet of cardboard on the street.

Honestly, it would be hard to meet a more committed or caring guy than Dr. Josh Bamberger, the medical director for the Housing and Urban Health Clinic. Granted, I only met him for a minute or two, but he's offering free medical care for anyone who walks through his door. What could his sinister angle be on that?

Or consider Mike Arrajj, a registered nurse who works at the 81-unit Empress Hotel, where residents pay an average of $300 a month to get a single room that is all their own. And that doesn't mean a room where they have to keep the door open to make sure that they aren't using drugs or drinking.

"What you can do in the privacy of your own home, they can do here," says Arrajj. "If it becomes a public issue (like noise, smell or violence) we do evict them."

But still, $300 a month for a room of your own in San Francisco? What's the problem with that? In all, the Department of Public Health says, roughly 3,700 "chronic and episodic homeless" have been housed, and the retention rate in those units runs above 90 percent.

Which is just great. But if the facilities are not a problem, and the single rooms seem to get results, why are there so many homeless people and vagrants on the street? Not only are they as visible as ever, in the view of some residents, but the official 2007 count shows there were 2,771 homeless people, up a bit from 2,655 in 2005.

So San Francisco is housing homeless and working to get them off the street, and the numbers have actually gone up. Why is that?

First, a couple of comments about the shelters. It is not true, as I thought, that bed shelters take the residents in early in the evening and turn them back out on the street at the crack of dawn. At Next Door, for example, residents can stay six months. During that time they keep the same bed, and can come and go as they please (although curfew is at 8 p.m.), and there is a metal locker beneath the bed that secures valuables.

Yet Rhorer says his department estimates an average of 100 empty beds a night. Homeless advocates counter that those beds are only released at 11 at night and that those are only 24-hour stays. However, if someone came to Next Door, for example, and agreed to take on case management, meaning an outreach worker, that person could be assigned a bed for six months. Someone who worked through the system to get an SRO (and there are complaints about how long that takes) could be in a room of his or her own, and 85 percent of those make it two years or longer.

So why not get into the program? There are gripes about the outreach workers, I suppose, that they pester residents to get rid of their drug or alcohol problems, but isn't that a small price to pay for a warm, dry place to live?

Friedenbach, of the Homeless Coalition, says the issues are complicated and go to the way people are treated. She says there have been reports of abuse, mostly verbal, from the staff of Next Door. And Diana Valentine, a member of the city's Shelter Monitoring Committee, says the group receives complaints about clogged toilets, broken doors and a lack of toilet paper.

OK, that's a problem. But is it reason enough to stay on the street? Ken Reggio, executive director of Episcopalian Community Services, which runs Next Door, says the shelter fills to capacity when it rains. So the homeless use the shelter if there is incentive.

"I think it is difficult for people to leave their community on the street," she says.

Or, to put it more directly, life on the street has its own appeal. Despite the best efforts of shelter groups, there are those who would rather live with friends in Golden Gate Park or on the street. (And some, of course, who are mentally ill, need much more than a room.) But for the other group, it isn't that they aren't being offered a chance, it is that they do not want to take it.

"The vast majority of homeless individuals are struggling and want to find housing," says Springwater. "But there is a small minority who choose to resist the structured program - in the case of Next Door, that means case management. That group has been out there so long that they are willing to maintain that life.