I ride on sidewalks in certain places where the street is simply too hazardous. You do need to be mindful that you're in the pedestrians' space, and they always have right of way; and of course slow down to near walking speed.
It's illegal for adults to ride on the sidewalk in my city, but not enforced at all. I'm pretty conscientious about following laws generally, but when faced with the choice between putting my life at risk on poorly designed roads, or breaking the law in a manner that harms no one, I choose to break the law.